main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
2.1 KB
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | module.exports = splunkSpl
|
---|
| 4 | splunkSpl.displayName = 'splunkSpl'
|
---|
| 5 | splunkSpl.aliases = []
|
---|
| 6 | function splunkSpl(Prism) {
|
---|
| 7 | Prism.languages['splunk-spl'] = {
|
---|
| 8 | comment: /`comment\("(?:\\.|[^\\"])*"\)`/,
|
---|
| 9 | string: {
|
---|
| 10 | pattern: /"(?:\\.|[^\\"])*"/,
|
---|
| 11 | greedy: true
|
---|
| 12 | },
|
---|
| 13 | // https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/ListOfSearchCommands
|
---|
| 14 | keyword:
|
---|
| 15 | /\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,
|
---|
| 16 | 'operator-word': {
|
---|
| 17 | pattern: /\b(?:and|as|by|not|or|xor)\b/i,
|
---|
| 18 | alias: 'operator'
|
---|
| 19 | },
|
---|
| 20 | function: /\b\w+(?=\s*\()/,
|
---|
| 21 | property: /\b\w+(?=\s*=(?!=))/,
|
---|
| 22 | date: {
|
---|
| 23 | // MM/DD/YYYY(:HH:MM:SS)?
|
---|
| 24 | pattern: /\b\d{1,2}\/\d{1,2}\/\d{1,4}(?:(?::\d{1,2}){3})?\b/,
|
---|
| 25 | alias: 'number'
|
---|
| 26 | },
|
---|
| 27 | number: /\b\d+(?:\.\d+)?\b/,
|
---|
| 28 | boolean: /\b(?:f|false|t|true)\b/i,
|
---|
| 29 | operator: /[<>=]=?|[-+*/%|]/,
|
---|
| 30 | punctuation: /[()[\],]/
|
---|
| 31 | }
|
---|
| 32 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.