Search commands
You can perform a search to troubleshoot issues by specifying a search criteria on the Search tab. Your search criteria (search string) can be composed of words, name=value pairs, fields, tags, and so on. For more information, see Searching-the-data. The search string is a set of expressions that are separated by various logical operators such as two ampersands (&&), two pipes (||), and so on. For more information, see Search string syntax.
This topic contains the following information:
Related topics
What are search commands?
Search commands are a set of commands containing arguments and can be run on the output of a particular search that you must have already performed. You can chain a set of search commands so that the output of one search command is consumed as the input to the subsequent search command. Multiple search commands can be chained by using a pipe separator (|).
Some of the commands add fields that you can use for further processing your data. For example, when you run the group command, the following fields are automatically added in each of the records displayed:
- duration
- numentries
- group_complete
For other commands such as extract or table, the additional field names are dynamic in nature and are added depending on the input specified. These fields can be used in subsequent commands added to your existing search query. These fields are virtual fields and cannot be added to the Fields section under the Filters panel.
Advantages of using search commands
At a high level, you can use search commands for the following purposes:
- Performing advanced analysis on your existing search results; for example, simple or complex pattern matching
- Simplifying your troubleshooting tasks
- Breaking down your search results into smaller parts
- Examining your search results from different viewpoints
- Manipulating your search results by using functions such as filtering and grouping
Use cases
The following example use cases provide scenarios that help you better understand the value of using search commands.
Supported search commands
The following table provides a list of supported search commands for achieving various goals:
Tabular commands
Search commands that provide tabular output are considered as tabular commands, which include the following:
Tabular commands provide a time-series representation of data in the form of a table of statistics and a corresponding chart based on the field or fields specified.
When you run a tabular command, by default, the results are summarized in the chart view. To see the results summarized in various ways, click the vertical three dots menu next to Chart View and select one of the following options:
- Show Tabular View: Displays search results in a table.
- Show Compare View: Displays search results as a chart and provides compare options that you can use to compare charts across different time contexts.
To return to the chart view, select Show Chart View from the vertical three dots menu.
The following table provides information about the various views available.
Kind of view | Description | |
---|---|---|
Chart View
| Provides a graphical representation of data. Click this view and select one of the following options to view a graphical representation of the search results. | |
Chart type | Click to preview | |
(Default) Bar | ||
Column | ||
Line | ||
The bars displayed in the chart are clickable. When you click a value in the table, the tabular view is toggled to the search results view and events associated with those values are displayed. By default, the legend is displayed. To hide the legend, clear the selected Show Legend check box. | ||
Tabular View | Provides a tabular representation of data. The values displayed in the table are clickable. When you click a value in the table, the tabular view is toggled to the search results view and events associated with those values are displayed. | |
Compare View | Select one of the following compare options and click Compare to see a comparison of charts; this helps you understand how your current search results differ from the compared time context. The original timeline chart is displayed with the notation C1 while the compared chart is displayed with the notation C2. To return to the compare options, click Compare Options. By default, the legend is hidden. To show legend, select the Show Legend check box. | |
Compare option | Example | |
(Default) Previous time context Compares current chart with the chart for | ||
Fixed time context, previous dayCompares current chart with the chart for | ||
Fixed time context, previous weekCompare current chart with the chart for | ||
Custom time Compare current chart with the chart for Note: By using this option, you can only |
Notes about using search commands
- When you run a search command, if you specify a field name that does not exist, search results that do not contain the field name are not impacted.
- If you use special characters such as double quotes (") and backslash (\) in your search syntax, you must use a backslash as an escaping character before the special character. For more information, see Escaping characters.
- Field names are case sensitive.
- Search commands that rely on fields work only if the specified field is present in the search results.