Exemplo n.º 1
0
        private static async Task SearchLog(LogSearchClient client, string compartmentId, string logGroupId, string logId)
        {
            DateTime          timeStart         = DateTime.Parse("12/09/2020 20:00:00");
            DateTime          timeEnd           = DateTime.Parse("12/09/2020 21:00:00");
            SearchLogsRequest searchLogsRequest = new SearchLogsRequest
            {
                SearchLogsDetails = new SearchLogsDetails
                {
                    SearchQuery = $"search \"{compartmentId}/{logGroupId}/{logId}\"",
                    TimeStart   = timeStart,
                    TimeEnd     = timeEnd
                },
                Limit = 5
            };

            logger.Info($"Searching log for entries between:{timeStart} to {timeEnd}");
            logger.Info("=============");
            SearchLogsResponse searchLogsResponse = await client.SearchLogs(searchLogsRequest);

            logger.Info($"Response OpcRequestId:{searchLogsResponse.OpcRequestId}");
            logger.Info($"Search Response count:{searchLogsResponse.SearchResponse.Results.Count}");
            foreach (var result in searchLogsResponse.SearchResponse.Results)
            {
                logger.Info($"data:{result.Data.ToString()}");
            }
        }
Exemplo n.º 2
0
        public async Task <SearchLogsResponse> SearchLogs(SearchLogsRequest o)
        {
            var result = new SearchLogsResponse(o.RequestId);

            result.Logs.AddRange(await Server.SearchLogEntries(o.Application, o.From, o.To, o.SearchTerm));

            return(result);
        }