-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Splunk SPL (#1962)
This adds support for Splunk SPL and corrects the position of the SQL in `components.json`.
- Loading branch information
1 parent
e8811d2
commit c93c066
Showing
13 changed files
with
446 additions
and
7 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Prism.languages['splunk-spl'] = { | ||
'comment': /`comment\("(?:\\.|[^\\"])*"\)`/, | ||
'string': { | ||
pattern: /"(?:\\.|[^\\"])*"/, | ||
greedy: true | ||
}, | ||
// https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/ListOfSearchCommands | ||
'keyword': /\b(?:abstract|accum|addcoltotals|addinfo|addtotals|analyzefields|anomalies|anomalousvalue|anomalydetection|append|appendcols|appendcsv|appendlookup|appendpipe|arules|associate|audit|autoregress|bin|bucket|bucketdir|chart|cluster|cofilter|collect|concurrency|contingency|convert|correlate|datamodel|dbinspect|dedup|delete|delta|diff|erex|eval|eventcount|eventstats|extract|fieldformat|fields|fieldsummary|filldown|fillnull|findtypes|folderize|foreach|format|from|gauge|gentimes|geom|geomfilter|geostats|head|highlight|history|iconify|input|inputcsv|inputlookup|iplocation|join|kmeans|kv|kvform|loadjob|localize|localop|lookup|makecontinuous|makemv|makeresults|map|mcollect|metadata|metasearch|meventcollect|mstats|multikv|multisearch|mvcombine|mvexpand|nomv|outlier|outputcsv|outputlookup|outputtext|overlap|pivot|predict|rangemap|rare|regex|relevancy|reltime|rename|replace|rest|return|reverse|rex|rtorder|run|savedsearch|script|scrub|search|searchtxn|selfjoin|sendemail|set|setfields|sichart|sirare|sistats|sitimechart|sitop|sort|spath|stats|strcat|streamstats|table|tags|tail|timechart|timewrap|top|transaction|transpose|trendline|tscollect|tstats|typeahead|typelearner|typer|union|uniq|untable|where|x11|xmlkv|xmlunescape|xpath|xyseries)\b/i, | ||
'operator-word': { | ||
pattern: /\b(?:and|as|by|not|or|xor)\b/i, | ||
alias: 'operator' | ||
}, | ||
'function': /\w+(?=\s*\()/, | ||
'property': /\w+(?=\s*=(?!=))/, | ||
'date': { | ||
// MM/DD/YYYY(:HH:MM:SS)? | ||
pattern: /\b\d{1,2}\/\d{1,2}\/\d{1,4}(?:(?::\d{1,2}){3})?\b/, | ||
alias: 'number' | ||
}, | ||
'number': /\b\d+(?:\.\d+)?\b/, | ||
'boolean': /\b(?:f|false|t|true)\b/i, | ||
'operator': /[<>=]=?|[-+*/%|]/, | ||
'punctuation': /[()[\],]/ | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h2>Full example</h2> | ||
<pre><code>source=monthly_data.csv | ||
| rename remote_ip AS ip | ||
| eval isLocal=if(cidrmatch("123.132.32.0/25",ip), "local", "not local") | ||
| eval error=case(status == 200, "OK", status == 404, "Not found", true(), "Other") | ||
`comment("TODO: Add support for more status codes")` | ||
| sort amount</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
`comment("This is a comment")` | ||
`comment("This is too | ||
but on more than one line")` | ||
`comment("| stats sum(b) BY index")` | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", "`comment(\"This is a comment\")`"], | ||
["comment", "`comment(\"This is too\r\nbut on more than one line\")`"], | ||
["comment", "`comment(\"| stats sum(b) BY index\")`"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
1/1/1970 | ||
12/31/1999:23:59:59 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["date", "1/1/1970"], | ||
["date", "12/31/1999:23:59:59"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for dates. |
Oops, something went wrong.