SumoLogic Concepts
Internal
Search
The search syntax is based on the "funnel" or the "pipeline" concept. The pipeline input receives all SumoLogic data, and data is filtered b entering keywords and operators, separated by pipes ("|"). Each operator acts on the results produced by previous operators, so data is being progressively filtered out. The typical search query syntax is similar to:
keyword search or string search | parse | where | group-by | sort | limit
All queries start with a keyword search or a string search.
As queries get longer and more complex, it is a best practice to format your queries by using a soft return before the pipes, such as:
_sourcecategory=apache | parse "* --" as src_ip | count by src_ip | sort _count
Searches are not instantaneous, and some of them can take a long time. Thus, they can be paused or canceled.
Searches can be saved in the Library. Once a search is saved, it can be further scheduled. To save a search, compose the search in an "Unnamed" tab, then "Save As". By default, the search is saved in the Personal folder.
Keyword Search
_sourceCategory=CloudWatch
String Search
Search Comments
// comments on a single line
/* multi-line comments */
Export Search Results
Up to 100,000 rows of CSV can be downloaded from the browser.
Search Job API
Keyword
Keywords are case insensitive.
How to figure out the complete list of valid keywords.
Most used keywords:
- _sourceCategory
Keyword expressions. Keyword expressions include metadata field expressions.
Field
The search language allows alphanumeric characters, hyphens and underscores for valid field names. If the field names contain special characters, a special syntax is required.
Metadata
Sumo Logic attaches metadata fields (or tags) to the log messages when the data is collected; the tags provide information about Collectors and Sources data was ingested from, the type of logs, etc. Usually, filtering by metadata tags is the first step in building a keyword search query. An overview of available metadata tags is presented below:
Metadata Fields (or Tags)
_collector
The name of the Collector, as set when the Collector was installed, that received the log message.
_source
The name of the Source, as set when the Source was configured.
_sourceName
The name of the log file, as the path that was uses when the Source was configured.
_sourceCategory
The category of the Source that collected the message. The source category can be a maximum of 1,024 characters.
_sourceCategory=CloudWatch
_sourceHost
The host name of the Source. For local Sources the name of the Source as set when the Source is configured. For remote Collectors, this field uses the remote host's name. The _sourceHost metadata field is populated using a reverse DNS lookup. If the name cannot be resolved, _sourceHost is displayed as "localhost". This can be a maximum of 128 characters.
_sourceHost=/up/test/up-plat-svc-blah
_messageCount
A sequence number, maintained by Source, added by the Collector when the message was received.
_messageTime
The timestamp of the message in milliseconds. If the message doesn't have a timestamp, _messageTime uses the _receiptTime.
_receiptTime
The time the Collector received the message in milliseconds. Also see User Receipt Time.
_size
The size of the log message in bytes.
_format
The pattern used for parsing the timestamp. See here for more details.
_raw
The raw log message.
Operator
Individual Operators
parse
Strings can be parsed based on start and stop anchor points in messages, and then aliased as user-created fields:
... | parse "* --" as src_ip | ...
The above parses out the IP address into a field named "src_ip", using an endpoint anchor.
sort
Sorting by the timestamp in natural order:
... | sort by +_messageTime
Also see Message Sorting below.
count
count by
keyvalue
... | keyvalue regex " ([A-Z_-]+?)='([^']+?)'" keys "TYPE", "MESSAGES", "CHANNEL", "DOCUMENT-URI" | count by %"docment-uri"
outlier
Group Operators
group by
example, did not work.
Pipe
Wildcards
'*' means zero or more characters.
? means a single character.
Collector
To access a list of all available Collectors: Sumo Logic -> Hamburger -> Manage Data -> Collection.
Source
A Source is an environment that produces data. Each Source is configured to collect files in a specific way, depending on the type of Collector is using.
Views
Message Table View
Message Sorting
By default, message sorting is configured to show the newest messages first. That can be changed as follows: the "Messages" tab -> top-right gear icon -> Display Message Preferences -> Sort By: "Oldest Message First".
Aggregates View
The Aggregates view seems to become available if a group operator is used. The view (tab) should be a peer of "Messages" tab. TO TEST. TO PROCESS https://help.sumologic.com/05Search/Get-Started-with-Search/Search-Basics/Chart-Search-Results
Metrics vs. Logs
Metrics
Logs
Charts
Alerts
Log Alerts
Metrics Alerts
The Library
Personal Folder
The "Personal" folder is accessible as Sumo Logic -> Hamburger -> The "Personal" folder icon or Sumo Logic -> Hamburger -> Library -> User's Name -> Personal