pub struct LogQuery { /* private fields */ }Expand description
The LogQueryClient of this SDK. Queries use Graylog’s Lucene syntax (marker:abc,
"exact phrase", level:<=3, trace_id:4bf9…).
Trait Implementations§
Source§impl LogQueryClient for LogQuery
impl LogQueryClient for LogQuery
Source§fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
opts: SearchOptions,
) -> Pin<Box<dyn Future<Output = Result<LogSearchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
opts: SearchOptions,
) -> Pin<Box<dyn Future<Output = Result<LogSearchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Normalized records (see log_record_from_message)
matching query between opts.start and opts.end (defaults: end = now, start = end −
the default window), newest first by default, ties broken by gl2_message_id. The cursor
is the offset of the next page; next_cursor is set while more matches exist and total
is Graylog’s match count.
Source§fn tail<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
on_record: RecordCallback,
opts: TailOptions,
) -> Pin<Box<dyn Future<Output = Result<TailHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn tail<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
on_record: RecordCallback,
opts: TailOptions,
) -> Pin<Box<dyn Future<Output = Result<TailHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Polls search every opts.interval (2 s when the template default of 1 s is kept;
Graylog has no streaming API) and calls on_record once per new matching record, oldest
first, starting at opts.start (default now). Each poll looks back 10 s before the
newest record seen and drops duplicates by message id, so late records are delivered
too. Search errors are logged and polling continues. The tail stops with the handle or
when the client is closed.
Source§fn list_streams<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_streams<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Titles of every stream (all pages, sorted).
Source§fn list_labels<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_labels<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Every indexed field name (GET /api/system/fields), sorted.
Source§fn wait_for_log<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
opts: WaitOptions,
) -> Pin<Box<dyn Future<Output = Result<LogRecord>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn wait_for_log<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
opts: WaitOptions,
) -> Pin<Box<dyn Future<Output = Result<LogRecord>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Polls search until a record matches (see wait_for_log).