Syntax highlighting
Color-coding makes the SPL2 commands, arguments, functions, and keywords easier to identify in the SPL2 Editor. This color-coding is called syntax highlighting.
The light theme and dark theme colors are similar for each search element. To change the color theme, see User customizations.
Light theme
The following table shows examples of the colors used for each search element on the light theme background:
Color | Search element | Examples |
---|---|---|
light gray | Comments. Both block and line comments are supported. See Using comments in SPL2 in the SPL2 Search Manual. | |
dark orange | Identifiers, such as dataset names, field names, command argument names, and function names. This also includes quoted identifiers such as the 'http status' field.
|
|
blue | Command names and keywords such as AS, BY, FUNCTION, and TYPE. This includes the names of the clauses used with the select and from commands, such as WHERE and GROUP BY.
|
|
red | Relative times including snap-to times such as -5m, +24h, -8days, @d7, -1d@d. See Specifying relative time in the SPL2 Search Manual | |
light brown | Strings and numeric values such as integer, double, float, long. | |
black | Delimiters such as pipe ( | ) characters, parenthesis ( ), commas, colons, square brackets { }, curly braces { }. | |
pink | Parameter names, such as the names of search statements and function parameters. For example $search16 or the names of function parameters like $field and $precision .
|
|
red | Data types such as string , number , and custom data types, like person . See Built-in data types in the SPL2 Search Reference.
|
|
dark grey | Terms that are used with the search command, numbers that are interpreted as strings, and the default color for elements that don't fit into other categories. |
Dark theme
The following table shows examples of the colors used for each search element on the dark theme background:
Color | Search element | Examples |
---|---|---|
light gray | Comments. Both block and line comments are supported. See Using comments in SPL2 in the SPL2 Search Manual. | |
dark orange | Identifiers, such as dataset names, field names, command argument names, and function names. This also includes quoted identifiers such as the 'http status' field.
|
|
blue | Command names and keywords such as AS, BY, FUNCTION, and TYPE. This includes the names of the clauses used with the select and from commands, such as WHERE and GROUP BY.
|
|
dark blue | Relative times including snap-to times such as -5m, +24h, -8days, @d7, -1d@d. See Specifying relative time in the SPL2 Search Manual | |
light brown | Strings and numeric values such as integer, double, float, long. | |
white | Delimiters such as pipe ( | ) characters, parenthesis ( ), commas, colons, square brackets { }, curly braces { }. | |
pink | Parameter names, such as the names of search statements and function parameters. For example $search16 or the names of function parameters like $field and $precision .
|
|
red | Data types such as string , number , and custom data types, like person . See Built-in data types in the SPL2 Search Reference.
|
|
bright white | Terms that are used with the search command, numbers that are interpreted as strings, and the default color for elements that don't fit into other categories. |
See also
- Search experience
- Search Experience overview
- SPL2 documentation
- Understanding SPL2 syntax in the SPL2 Search Reference
Keyboard shortcuts | User customizations |
This documentation applies to the following versions of Splunk Cloud Platform™: search2preview
Feedback submitted, thanks!