Bronto provides a simple point-and-click query builder for you to search, analyse and visualise your log data. We have several views which include Timeseries, Table, Top List, Pie Chart and Tree Map. These are explained in more detail here.
key:value
and SQL like syntax.
host:127.0.0.1 level:error
When you enter any word or sequence of characters into the search bar, e.g., error
or 127.0.0.1
, the query will only match events that contain that word somewhere in their text (ignoring uppercase/lowercase differences). You can combine multiple terms using the following operators:
Operator | Example | Description |
---|---|---|
AND | authentication AND failure | Matches log events that contain both authentication and failure in their text. |
OR | authenthication OR password | Matches log events that contain either authentication or password in their text. |
NOT | NOT success | Matches log events that do not contain success in their text. |
AND
operators, for example, searching for Mac OS
will match the events which contain both the word Mac
and the word OS
somewhere in their text, but not necessarily in that order (use quotes to escape spaces and avoid this behaviour).
You can also search on specific attributes by typing a colon-separated attribute-value pair into the search bar, e.g., level:error
or host:127.0.0.1
, which matches all log events which contain the specified attribute with the specified value. Attribute-value text searches are case-sensitive.
<
,>
, <=
, or >=
) For instance, retrieve all logs that have a response_status greater than 400:
response_status:>400
'
or double "
quotes if it contains spaces or any of the following special characters: :
, =
, >
, <
, !
.
Similarly, if your term is a reserved keyword (AND
, OR
, and NOT
), then the term will need to be wrapped with quotes.
WHERE
clauseWHERE
clause of a SELECT
SQL statement, and can be used to filter the results of your query. For example, you can search your firewall logs for users accessing a specific destination with
direction
with a value equal to 'outbound'
and a field destination_address
equal to '52.214.86.65'
.
outbound
” would be interpreted as a field rather than a string value.ILIKE
expression that checks whether the string appears anywhere in the log event. To search for any event that contains "username"
as well as either "500"
or "404"
, you can query with
username
is automatically expanded to @raw ILIKE '%username%'
. This behaviour is the same for both quoted and unquoted character strings, so single quotes may be omitted.
Fields that begin with @
are reserved fields that contain some special information:
Field | Description | |
---|---|---|
@raw | The full text of a log event in its raw form. | |
@time | The timestamp when Bronto received the event, in the format YYYY-MM-DD hh:mm:ss.sss UTC . | |
@timestamp | The timestamp when Bronto received the event, in milliseconds since the Unix epoch. | |
@origin | The ip address from which Bronto received the event. |
TRUE
, FALSE
or UNKNOWN
.
Boolean Operator | Example | Description |
---|---|---|
AND | expr1 AND expr2 | Combines two expressions and returns TRUE when both expressions are TRUE . |
OR | expr1 OR expr2 | Combines two expressions and returns TRUE when either expressions is TRUE . |
NOT | NOT expr | Negates the result of the expression. |
TRUE
, FALSE
or UNKNOWN
.
Comparison Operator | Example | Description |
---|---|---|
[NOT] LIKE | field LIKE '%value%' | Returns TRUE if the left operand matches the specified pattern (right operand). The pattern can include regular characters or the % wildcard, which matches 0 or more of any character. For example, field LIKE 'foo%' returns any log events that start with “foo”. The regular characters specified in the pattern are case sensitive and must match exactly. This operator is only applicable to the STRING data type. The result is negated if NOT appears before the LIKE operator. |
[NOT] ILIKE | field ILIKE '%value%' | Same behaviour as the LIKE operator, uppercase/lowercase differences are ignored when matching a pattern. |
= | field = value | Compares the equality of two expressions. Returns TRUE if both expressions are equal to each other. |
<> | field <> value | Compares the equality of two expressions. Returns TRUE if the left operand is not equal to the right operand. |
!= | field != value | Same as the <> operator. Compares the equality of two expressions. Returns TRUE if the left operand is not equal to the right operand. |
< | field < value | Compares two expressions. Returns TRUE if the left operand has a lower value than the right operand, otherwise the result is False . |
<= | field <= value | Compares two expressions. Returns TRUE if the left operand has a value lower than or equal to the right operand, otherwise the result is False . |
> | field > value | Compares two expressions. Returns TRUE if the left operand has a greater value than the right operand, otherwise the result is False . |
>= | field >= value | Compares two expressions. Returns TRUE if the left operand has a value greater than or equal to the right operand, otherwise the result is False . |
1
being the highest precedence, and 4
being the lowest. An operator with a higher precedence is evaluated before an operator with a lower precedence.
Level | Operators |
---|---|
1 | = , != , <> , < , > , <= , >= |
2 | [NOT] LIKE , [NOT] ILIKE |
3 | NOT |
4 | AND |
5 | OR |
Quote Type | Purpose | Example |
---|---|---|
Single quotes ('' ) | STRING literals (values) | 'error' |
Double quotes ("" ) | Column names | "status_code" |
"request-time"
refers to a column name that includes a dash (-
).
'
) for STRING literals (values)
'critical'
, 'timeout exceeded'
"
) for columns (keys in a log line)
"status"
, "request-time"
, "geo_country"
'
and double "
) can be escaped by doubling them up, for example 'O''Brien'
is a STRING
literal with an apostrophe (O'Brien
).
Data type | Description | Literal Value |
---|---|---|
NUMERIC | Exact number data type for integer data. Valid for integers in the range -2^63 to 2^63-1 . | Any unquoted sequence of digits. |
DOUBLE | Approximate number data type for decimal data. Precise to 15 significant decimal digits. | Any unquoted sequence of digits with a single . character anywhere in that sequence. |
STRING | Data type for variable length character strings that can consist of letters, numbers, and symbols. | Any sequence of characters surrounded by single quotes. |
duration=0.1291
it will match both duration<1
(LONG
literal) and duration<'1'
(STRING
literal).
The rules for implicit data type conversion for binary operators are as follows:
Precedence | Condition | Implicit Conversion |
---|---|---|
1 | Both sides are attributes. | No implicit conversion takes place. |
2 | One side is of type DOUBLE and the other side can be converted to DOUBLE . | Other side converted to DOUBLE . |
3 | One side is of type LONG and the other side can be converted to LONG . | Other side converted to LONG . |
4 | One side is an attribute with a STRING value and the other side is of type LONG or DOUBLE . | No implicit conversion takes place. Due to the schemaless nature of Bronto it is possible for an attribute to hold values with differing datatypes. This rule exists to avoid lexicographical STRING comparison when a numerical comparison was intended, for example, this means that if your log event has attribute duration equal to 'null' then duration>100 will NOT return TRUE (as it would under a lexicographical string comparison). |
5 | One side is of type STRING . | Other side is converted to STRING . |
6 | None of the previous conditions match. | No implicit conversion takes place. |
Function | Example | Description |
---|---|---|
LOWER | LOWER('Error') | Returns a string after converting any uppercase characters to lowercase. The function can be applied to a constant string or a column. |
.
(any character), \d
(any number), \s
(any whitespace), and [xyz]
(any character that is either x
, y
or z
), and repetition operators: *
matches a sequence of zero or more string; +
matches one or more; ?
matches zero or none. For example, the regex cat*
matches cat
followed by any characters (or none at all). For example,
cat.*
matches "catapult"
cat.*
matches "The cat sat"
h[aeiou]llo
matches any of "hallo", "hello", "hollo"
(?i)cat
matches "cat"
, "CAT"
, "cAt"
((?i)
is the case-insensitive inline modifier)
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
matches email addresses.
colou?r
will match the log event “My favourite colour is red” - it is not necessary to write .*colou?r.*
.
Operator | Example | Description |
---|---|---|
[NOT] REGEXP | field REGEXP '197\.149\.[12][0-59][0-9]\.[0-2].*' | Returns TRUE if the left operand matches the specified regex pattern (right operand). This operator is only applicable to the STRING data type. The result is negated if NOT appears before the REGEXP operator. |
[NOT] RLIKE | field RLIKE '197\.149\.[12][0-59][0-9]\.[0-2].*' | Same behaviour as the REGEXP operator. |
~ | field ~ value | Same behaviour as the REGEXP operator. |
!~ | field !~ value | Same behaviour as the NOT REGEXP operator. |
~* | field ~* value | Same behaviour as the REGEXP operator, but with a case insensitive modifier. |
!~* | field !~* value | Same behaviour as the REGEXP operator, but with a case insensitive modifier. |
PATTERN
is a regex pattern, and name
denotes the attribute you want to parse.
For example, suppose you are working with this unstructured custom log:
count
, min
, max
.
REPORT
:
(?<message>.*?)
element to
max(altitude)
function to our query.