Exemple #1
0
        public virtual string AddQuery(string workspaceId, string query, TimeSpan?timeSpan = null)
        {
            var id = _counter.ToString("G", CultureInfo.InvariantCulture);

            _counter++;
            _batch.Requests.Add(new LogQueryRequest()
            {
                Id        = id,
                Body      = LogsClient.CreateQueryBody(query, timeSpan),
                Workspace = workspaceId
            });
            return(id);
        }
Exemple #2
0
        public virtual string AddQuery(string workspaceId, string query, TimeSpan?timeSpan = null, LogsQueryOptions options = null)
        {
            var id = _counter.ToString("G", CultureInfo.InvariantCulture);

            _counter++;
            var logQueryRequest = new LogQueryRequest()
            {
                Id        = id,
                Body      = LogsClient.CreateQueryBody(query, timeSpan, options, out string prefer),
                Workspace = workspaceId
            };

            if (prefer != null)
            {
                logQueryRequest.Headers.Add("prefer", prefer);
            }
            _batch.Requests.Add(logQueryRequest);
            return(id);
        }