Search command primer
At the beginning of a search pipeline, the search
command is implied, even though you do not explicitly specify it. If you type in
host=webserver*
It is as if you typed in
search host=webserver*
Use keywords, phrases, fields, boolean expressions, and comparison expressions to specify exactly which events you want to retrieve from Splunk indexes.
For specific information see:
- Wildcards
- Backslashes
- Boolean expressions
- Field expressions
- Difference between NOT and !=
- Use CASE and TERM to match phrases
- SPL and regular expressions
Keywords and phrases
By default, when you search with keywords and phrases, Splunk software retrieves events by matching against the raw event field, _raw
, in your data. When you start adding search modifiers, such as fields like _time
and tag
, you are also matching against pieces of information that have been extracted from the _raw
field.
When searching for strings, which includes keywords and quoted phrases (or anything that's not a search modifier), Splunk software searches the _raw
field for the matching events or results. Some examples of keywords and phrases are:
web
error
web error
"web error"
Note that the search for the quoted phrase "web error" is not the same as the search before it. When you search for web error
, Splunk software returns events that contain both "web" and "error". When you search for "web error", Splunk software only returns events that contain the phrase "web error".
File paths
To search for a file path, such as D:\Digital\RTFM
, you must escape the backslash characters in the path, for example D:\\Digital\\RTFM
.
If the file path contains spaces you must enclose the path in quotation marks. For example:
"D:\\Digital\\RTFM Backup Folder"
A space is considered a major breaker in data. To learn more about major and minor breakers, see Event segmentation and searching.
See Also
Search history | Wildcards |
This documentation applies to the following versions of Splunk Cloud Platform™: 8.2.2112, 8.2.2201, 8.2.2202, 8.2.2203, 9.0.2205, 9.0.2208, 9.0.2209, 9.0.2303, 9.0.2305, 9.1.2308, 9.1.2312, 9.2.2403, 9.2.2406 (latest FedRAMP release), 9.3.2408
Feedback submitted, thanks!