rouge-lexer-spl 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +94 -0
- data/lib/rouge/lexers/spl.rb +118 -81
- data/spec/visual/samples/spl +15 -4
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 450ea9a0cce00914039ec808a58477b6baadde9b429946d4ba68ed0121e980f4
|
|
4
|
+
data.tar.gz: 9119b5cd29f2034885699c1ce7589d2f4a0a3cf6acce2e6150b6d1fac12b8fd0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ddf2519c5882dcf07e3edd0ed8ab29eaefd8cf2074ee5709825357a2802d24b8362f9249a45fa6a9832675361518472215b3b3671cdab6933ec930481d3a3fcd
|
|
7
|
+
data.tar.gz: d6ddf3c9803e7d747693965702eab614eb2f396c6681026a87bf55e1f5005d7b18e772a8a58d4212a33bf8dba5164438ac98411cbc8cb00a722290d727303d3b
|
data/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# rouge-lexer-spl
|
|
2
|
+
|
|
3
|
+
A Rouge lexer plugin for Splunk's Search Processing Language (SPL). Rouge is the default syntax highlighter for Jekyll (and therefore GitHub Pages). This gem adds SPL support to Rouge.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the gem directly:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
gem install rouge-lexer-spl
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or add it to your `Gemfile`:
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
gem 'rouge-lexer-spl'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then run:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
bundle install
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
Once installed, Rouge will automatically discover the lexer. You can use `spl`, `splunk`, or `splunk-spl` as the language tag in fenced code blocks:
|
|
28
|
+
|
|
29
|
+
````markdown
|
|
30
|
+
```spl
|
|
31
|
+
index=web sourcetype=access_combined | stats count by status
|
|
32
|
+
```
|
|
33
|
+
````
|
|
34
|
+
|
|
35
|
+
## Jekyll / GitHub Pages
|
|
36
|
+
|
|
37
|
+
Add the gem to your site's `Gemfile` inside the `:jekyll_plugins` group:
|
|
38
|
+
|
|
39
|
+
```ruby
|
|
40
|
+
group :jekyll_plugins do
|
|
41
|
+
gem "rouge-lexer-spl"
|
|
42
|
+
end
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Run `bundle install`, then use ` ```spl ` fences in your posts and pages. Jekyll will pick up the lexer automatically via Rouge's plugin discovery.
|
|
46
|
+
|
|
47
|
+
## Development
|
|
48
|
+
|
|
49
|
+
Install dependencies:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
bundle install
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Run the test suite:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
bundle exec rake
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Start the visual preview server (available at http://localhost:9292):
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
bundle exec rake server
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Run the terminal preview script:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
ruby preview.rb
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Enable debug mode to print each token and its value:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
DEBUG=1 ruby preview.rb
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Iterative testing workflow
|
|
80
|
+
|
|
81
|
+
1. Run `bundle exec rake` to check for test failures and error tokens.
|
|
82
|
+
2. Start the server with `bundle exec rake server`.
|
|
83
|
+
3. In another terminal, check for error tokens in the rendered output:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
curl -s http://localhost:9292 | grep 'class="err"'
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
4. Fix any error tokens in `lib/rouge/lexers/spl.rb`.
|
|
90
|
+
5. Repeat until no error tokens remain.
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT
|
data/lib/rouge/lexers/spl.rb
CHANGED
|
@@ -16,87 +16,117 @@ module Rouge
|
|
|
16
16
|
return true if text =~ /\bindex\s*=\s*\w+/i && text =~ /\bsourcetype\s*=\s*/i
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
# SPL commands
|
|
19
|
+
# SPL commands
|
|
20
|
+
# Sources: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/quick-reference/command-quick-reference
|
|
21
|
+
# https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/quick-reference/command-types
|
|
20
22
|
def self.commands
|
|
21
23
|
@commands ||= Set.new %w(
|
|
22
24
|
abstract accum addcoltotals addinfo addtotals analyzefields
|
|
23
25
|
anomalies anomalousvalue anomalydetection append appendcols
|
|
24
|
-
appendpipe arules associate autoregress bin bucket
|
|
25
|
-
chart cluster cofilter collect concurrency contingency
|
|
26
|
-
correlate datamodel dbinspect
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
appendpipe arules associate autoregress awssnsalert bin bucket
|
|
27
|
+
bucketdir chart cluster cofilter collect concurrency contingency
|
|
28
|
+
convert correlate ctable datamodel datamodelsimple dbinspect
|
|
29
|
+
dbxquery dedup delete delta diff entitymerge erex eval eventcount
|
|
30
|
+
eventstats extract fieldformat fields fieldsummary filldown
|
|
31
|
+
fillnull findtypes folderize foreach format from fromjson gauge
|
|
32
|
+
gentimes geom geomfilter geostats head highlight history iconify
|
|
33
|
+
ingestpreview inputcsv inputintelligence inputlookup iplocation
|
|
34
|
+
join kmeans kvform loadjob localize localop lookup makecontinuous
|
|
35
|
+
makemv makeresults map mcollect metadata metasearch meventcollect
|
|
36
|
+
mpreview msearch mstats multikv multisearch mvcombine mvexpand
|
|
37
|
+
nomv noop outlier outputcsv outputlookup outputtext overlap pivot
|
|
38
|
+
predict rangemap rare redistribute regex reltime rename replace
|
|
39
|
+
require rest return reverse rex rtorder run savedsearch script
|
|
40
|
+
scrub search searchtxn selfjoin sendalert sendemail set setfields
|
|
41
|
+
sichart sirare sistats sitimechart sitop snowevent snoweventstream
|
|
42
|
+
snowincident snowincidentstream sort spath stats strcat
|
|
39
43
|
streamstats table tags tail timechart timewrap tojson top
|
|
40
44
|
transaction transpose trendline tscollect tstats typeahead
|
|
41
45
|
typelearner typer union uniq untable walklex where x11 xmlkv
|
|
42
|
-
xmlunescape xpath xyseries
|
|
46
|
+
xmlunescape xpath xyseries
|
|
43
47
|
)
|
|
44
48
|
end
|
|
45
49
|
|
|
46
|
-
# Evaluation functions
|
|
50
|
+
# Evaluation functions
|
|
51
|
+
# Sources:
|
|
52
|
+
# Bitwise: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/bitwise-functions
|
|
53
|
+
# Comparison: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/comparison-and-conditional-functions
|
|
54
|
+
# Conversion: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/conversion-functions
|
|
55
|
+
# Cryptographic: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/cryptographic-functions
|
|
56
|
+
# Date/Time: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/date-and-time-functions
|
|
57
|
+
# Informational: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/informational-functions
|
|
58
|
+
# JSON: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/json-functions
|
|
59
|
+
# Mathematical: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/mathematical-functions
|
|
60
|
+
# Multivalue: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/multivalue-eval-functions
|
|
61
|
+
# Statistical: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/statistical-eval-functions
|
|
62
|
+
# Text: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/text-functions
|
|
63
|
+
# Trig: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/evaluation-functions/trig-and-hyperbolic-functions
|
|
64
|
+
# Convert cmd: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/search-commands/convert
|
|
47
65
|
def self.eval_functions
|
|
48
66
|
@eval_functions ||= Set.new %w(
|
|
49
67
|
abs acos acosh asin asinh atan atan2 atanh avg
|
|
50
|
-
bit_and
|
|
51
|
-
case
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
68
|
+
bit_and bit_not bit_or bit_shift_left bit_shift_right bit_xor
|
|
69
|
+
case ceil ceiling cidrmatch coalesce commands cos cosh
|
|
70
|
+
ctime dur2sec
|
|
71
|
+
exact exp false floor hypot if ipmask
|
|
72
|
+
isarray isbool isdouble isint ismv isnotnull isnull isnum isobject isstr
|
|
73
|
+
json json_append json_array json_array_to_mv json_delete json_entries
|
|
55
74
|
json_extend json_extract json_extract_exact json_has_key_exact
|
|
56
|
-
json_keys json_object json_set json_set_exact json_valid
|
|
57
|
-
like ln log lower ltrim match max md5 min
|
|
58
|
-
mvdedup mvfilter mvfind mvindex
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
toobject tostring trim true typeof
|
|
75
|
+
json_keys json_object json_set json_set_exact json_valid
|
|
76
|
+
len like ln log lower ltrim match max md5 memk min mktime mstime
|
|
77
|
+
mv_to_json_array mvappend mvcount mvdedup mvfilter mvfind mvindex
|
|
78
|
+
mvjoin mvmap mvrange mvreverse mvsort mvzip
|
|
79
|
+
now null nullif pi pow printf random relative_time replace rmcomma
|
|
80
|
+
rmunit round rtrim searchmatch sha1 sha256 sha512 sigfig sin sinh
|
|
81
|
+
split sqrt spath strftime strptime substr sum tan tanh time toarray
|
|
82
|
+
tobool todouble toint tomv tonumber toobject tostring trim true typeof
|
|
83
|
+
upper urldecode validate
|
|
64
84
|
)
|
|
65
85
|
end
|
|
66
86
|
|
|
67
|
-
# Statistical and charting functions
|
|
87
|
+
# Statistical and charting functions
|
|
88
|
+
# Sources:
|
|
89
|
+
# Aggregate: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/statistical-and-charting-functions/aggregate-functions
|
|
90
|
+
# Event order: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/statistical-and-charting-functions/event-order-functions
|
|
91
|
+
# Multivalue: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/statistical-and-charting-functions/multivalue-stats-and-chart-functions
|
|
92
|
+
# Time: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/statistical-and-charting-functions/time-functions
|
|
68
93
|
def self.stats_functions
|
|
69
94
|
@stats_functions ||= Set.new %w(
|
|
70
|
-
avg count
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
95
|
+
avg average c count dc distinct_count earliest earliest_time
|
|
96
|
+
estdc estdc_error first last latest latest_time list max mean
|
|
97
|
+
median min mode per_day per_hour per_minute per_second range rate
|
|
98
|
+
rate_avg rate_sum sparkline stdev stdevp sum sumsq upperperc
|
|
99
|
+
values var varp
|
|
75
100
|
)
|
|
76
101
|
end
|
|
77
102
|
|
|
78
103
|
# Operator keywords
|
|
104
|
+
# Source: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/introduction/understanding-spl-syntax
|
|
105
|
+
# https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/search-commands/replace
|
|
106
|
+
# https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/search-commands/lookup
|
|
79
107
|
def self.operator_words
|
|
80
108
|
@operator_words ||= Set.new %w(
|
|
81
|
-
AND
|
|
109
|
+
AND AS BY IN LIKE NOT OR OUTPUT OUTPUTNEW OVER WHERE WITH XOR
|
|
82
110
|
)
|
|
83
111
|
end
|
|
84
112
|
|
|
85
|
-
#
|
|
113
|
+
# Boolean and null constants
|
|
86
114
|
def self.constants
|
|
87
115
|
@constants ||= Set.new %w(
|
|
88
|
-
|
|
116
|
+
false FALSE null NULL true TRUE
|
|
89
117
|
)
|
|
90
118
|
end
|
|
91
119
|
|
|
92
|
-
# Built-in
|
|
120
|
+
# Built-in and internal fields
|
|
121
|
+
# Sources: Splunk internal metadata fields;
|
|
122
|
+
# https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.2/search-commands/addinfo
|
|
93
123
|
def self.builtin_fields
|
|
94
124
|
@builtin_fields ||= Set.new %w(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
125
|
+
_bkt _cd _indextime _kv _raw _serial _si _sourcetype _subsecond _time
|
|
126
|
+
date_hour date_mday date_minute date_month date_second date_wday
|
|
127
|
+
date_year date_zone eventtype host index info_max_time info_min_time
|
|
128
|
+
info_search_time info_sid linecount punct source sourcetype
|
|
129
|
+
splunk_server tag timeendpos timestartpos
|
|
100
130
|
)
|
|
101
131
|
end
|
|
102
132
|
|
|
@@ -107,65 +137,72 @@ module Rouge
|
|
|
107
137
|
# Block comments (triple backtick)
|
|
108
138
|
rule %r/```/, Comment::Multiline, :block_comment
|
|
109
139
|
|
|
110
|
-
# Single-line comments (starting with ` followed by content)
|
|
111
|
-
# SPL doesn't have single-line comments in the traditional sense
|
|
112
|
-
|
|
113
140
|
# Double-quoted strings
|
|
114
141
|
rule %r/"/, Str::Double, :double_string
|
|
115
142
|
|
|
116
|
-
# Single-quoted strings (field names)
|
|
143
|
+
# Single-quoted strings (field names / literal values)
|
|
117
144
|
rule %r/'/, Str::Single, :single_string
|
|
118
145
|
|
|
119
|
-
# Backtick
|
|
146
|
+
# Backtick macro references (not triple backtick)
|
|
120
147
|
rule %r/`(?!``)/, Name::Function, :backtick_string
|
|
121
148
|
|
|
122
|
-
#
|
|
123
|
-
rule %r
|
|
124
|
-
rule %r/-?\d+(?:e[+-]?\d+)?/i, Num::Integer
|
|
149
|
+
# Macro argument substitution: $varname$
|
|
150
|
+
rule %r/\$\w+\$/, Name::Variable
|
|
125
151
|
|
|
126
|
-
#
|
|
127
|
-
rule %r
|
|
152
|
+
# Numeric literals — floats before integers to avoid partial matches
|
|
153
|
+
rule %r/\d+\.\d+(?:e[+-]?\d+)?/i, Num::Float
|
|
154
|
+
rule %r/\d+(?:e[+-]?\d+)?/i, Num::Integer
|
|
128
155
|
|
|
129
|
-
#
|
|
130
|
-
rule %r/[\[\]]/, Punctuation
|
|
156
|
+
# Brackets and braces
|
|
157
|
+
rule %r/[\[\]{}]/, Punctuation
|
|
131
158
|
|
|
132
159
|
# Pipe operator
|
|
133
160
|
rule %r/\|/, Punctuation
|
|
134
161
|
|
|
135
|
-
# Comparison
|
|
136
|
-
rule %r/[
|
|
162
|
+
# Comparison operators (longest match first)
|
|
163
|
+
rule %r/[<>!]=|[<>]/, Operator
|
|
137
164
|
rule %r/==/, Operator
|
|
138
165
|
|
|
139
|
-
# Arithmetic and string
|
|
166
|
+
# Arithmetic and string-concatenation operators
|
|
140
167
|
rule %r/[+\-*\/%]/, Operator
|
|
141
168
|
rule %r/\.\./, Operator
|
|
142
|
-
rule %r
|
|
169
|
+
rule %r/\./, Operator
|
|
170
|
+
|
|
171
|
+
# Time snap operator and other special characters
|
|
172
|
+
rule %r/@/, Operator
|
|
173
|
+
rule %r/:/, Punctuation
|
|
174
|
+
rule %r/\$/, Operator
|
|
143
175
|
|
|
144
176
|
# Other punctuation
|
|
145
177
|
rule %r/[(),;]/, Punctuation
|
|
146
178
|
|
|
147
|
-
#
|
|
179
|
+
# Assignment / field=value
|
|
148
180
|
rule %r/=/, Operator
|
|
149
181
|
|
|
150
182
|
# Wildcard
|
|
151
183
|
rule %r/\*/, Operator
|
|
152
184
|
|
|
185
|
+
# Functions with required numeric suffix:
|
|
186
|
+
# Percentile: perc90, p95, exactperc99, upperperc90
|
|
187
|
+
# Trendline: sma5, ema10, wma20 (Source: https://help.splunk.com/.../search-commands/trendline)
|
|
188
|
+
rule %r/(?:exactperc|upperperc|perc|sma|ema|wma|p)\d+\b/, Name::Builtin
|
|
189
|
+
|
|
153
190
|
# Words — classify by set membership
|
|
154
191
|
rule %r/\w+/ do |m|
|
|
155
|
-
word
|
|
156
|
-
word_upper = word.upcase
|
|
192
|
+
word = m[0]
|
|
157
193
|
word_lower = word.downcase
|
|
158
|
-
|
|
194
|
+
word_upper = word.upcase
|
|
195
|
+
if self.class.constants.include?(word)
|
|
159
196
|
token Keyword::Constant
|
|
160
|
-
elsif self.class.operator_words.include?
|
|
197
|
+
elsif self.class.operator_words.include?(word_upper)
|
|
161
198
|
token Keyword::Pseudo
|
|
162
|
-
elsif self.class.commands.include?
|
|
199
|
+
elsif self.class.commands.include?(word_lower)
|
|
163
200
|
token Keyword
|
|
164
|
-
elsif self.class.eval_functions.include?
|
|
201
|
+
elsif self.class.eval_functions.include?(word_lower)
|
|
165
202
|
token Name::Builtin
|
|
166
|
-
elsif self.class.stats_functions.include?
|
|
203
|
+
elsif self.class.stats_functions.include?(word_lower)
|
|
167
204
|
token Name::Builtin
|
|
168
|
-
elsif self.class.builtin_fields.include?
|
|
205
|
+
elsif self.class.builtin_fields.include?(word_lower)
|
|
169
206
|
token Name::Variable::Magic
|
|
170
207
|
else
|
|
171
208
|
token Name
|
|
@@ -174,25 +211,25 @@ module Rouge
|
|
|
174
211
|
end
|
|
175
212
|
|
|
176
213
|
state :block_comment do
|
|
177
|
-
rule %r/```/,
|
|
178
|
-
rule %r/[^`]+/,
|
|
179
|
-
rule %r/`/,
|
|
214
|
+
rule %r/```/, Comment::Multiline, :pop!
|
|
215
|
+
rule %r/[^`]+/, Comment::Multiline
|
|
216
|
+
rule %r/`/, Comment::Multiline
|
|
180
217
|
end
|
|
181
218
|
|
|
182
219
|
state :double_string do
|
|
183
|
-
rule %r/\\./,
|
|
184
|
-
rule %r/"/,
|
|
185
|
-
rule %r/[^\\"]+/,
|
|
220
|
+
rule %r/\\./, Str::Escape
|
|
221
|
+
rule %r/"/, Str::Double, :pop!
|
|
222
|
+
rule %r/[^\\"]+/, Str::Double
|
|
186
223
|
end
|
|
187
224
|
|
|
188
225
|
state :single_string do
|
|
189
|
-
rule %r/\\./,
|
|
190
|
-
rule %r/'/,
|
|
191
|
-
rule %r/[^\\']+/,
|
|
226
|
+
rule %r/\\./, Str::Escape
|
|
227
|
+
rule %r/'/, Str::Single, :pop!
|
|
228
|
+
rule %r/[^\\']+/, Str::Single
|
|
192
229
|
end
|
|
193
230
|
|
|
194
231
|
state :backtick_string do
|
|
195
|
-
rule %r/`/,
|
|
232
|
+
rule %r/`/, Name::Function, :pop!
|
|
196
233
|
rule %r/[^`]+/, Name::Function
|
|
197
234
|
end
|
|
198
235
|
end
|
data/spec/visual/samples/spl
CHANGED
|
@@ -96,9 +96,13 @@ index=main earliest=-30m latest=now
|
|
|
96
96
|
|
|
97
97
|
| eval rand_num=random()
|
|
98
98
|
|
|
99
|
+
| eval rounded_up=ceil(3.2)
|
|
100
|
+
| eval reversed=mvreverse(myfield)
|
|
101
|
+
|
|
99
102
|
index=main sourcetype=access_combined
|
|
100
103
|
| stats count AS total_requests,
|
|
101
104
|
avg(response_time) AS avg_response,
|
|
105
|
+
average(response_time) AS avg_response2,
|
|
102
106
|
max(response_time) AS max_response,
|
|
103
107
|
min(response_time) AS min_response,
|
|
104
108
|
dc(clientip) AS unique_clients,
|
|
@@ -114,7 +118,8 @@ index=main sourcetype=access_combined
|
|
|
114
118
|
values(method) AS methods,
|
|
115
119
|
earliest(_time) AS first_seen,
|
|
116
120
|
latest(_time) AS last_seen,
|
|
117
|
-
perc95(response_time) AS p95
|
|
121
|
+
perc95(response_time) AS p95,
|
|
122
|
+
sparkline count
|
|
118
123
|
BY host, sourcetype
|
|
119
124
|
|
|
120
125
|
index=main
|
|
@@ -175,7 +180,8 @@ index=main sourcetype=access_combined
|
|
|
175
180
|
| where status IN (200, 301, 404, 500)
|
|
176
181
|
|
|
177
182
|
| convert timeformat="%Y-%m-%d" ctime(_time) AS event_date
|
|
178
|
-
| convert rmunit(percent_cpu)
|
|
183
|
+
| convert rmunit(percent_cpu) dur2sec(response_duration) rmcomma(revenue)
|
|
184
|
+
| convert memk(memory_used) mstime(elapsed_time) mktime(event_date_str) AS epoch
|
|
179
185
|
|
|
180
186
|
status!=200 AND (method="POST" OR method="PUT") NOT url="*/health*"
|
|
181
187
|
|
|
@@ -194,14 +200,19 @@ true false TRUE FALSE null NULL
|
|
|
194
200
|
|
|
195
201
|
_time _raw host source sourcetype index
|
|
196
202
|
|
|
203
|
+
| addinfo
|
|
204
|
+
_time info_min_time info_max_time info_sid info_search_time
|
|
205
|
+
|
|
197
206
|
| transaction host maxspan=5m maxpause=30s
|
|
198
207
|
| iplocation clientip
|
|
199
208
|
| geostats latfield=lat longfield=lon count BY status
|
|
200
209
|
|
|
201
210
|
| predict response_time AS predicted_response future_timespan=24
|
|
202
|
-
| trendline sma5(response_time) AS
|
|
211
|
+
| trendline sma5(response_time) AS sma_trend ema10(response_time) AS ema_trend wma20(response_time) AS wma_trend
|
|
203
212
|
| anomalydetection field=response_time
|
|
204
213
|
|
|
214
|
+
| noop
|
|
215
|
+
|
|
205
216
|
| makeresults count=10
|
|
206
217
|
| eval random_val=random() % 100
|
|
207
218
|
| outputlookup my_lookup.csv
|
|
@@ -219,7 +230,7 @@ index=main
|
|
|
219
230
|
| makemv delim="," values
|
|
220
231
|
| mvexpand values
|
|
221
232
|
|
|
222
|
-
| foreach * [eval
|
|
233
|
+
| foreach bytes_* [eval total=total+bytes_out]
|
|
223
234
|
| eval result=printf("%s has %d errors (%.2f%%)", host, count, pct)
|
|
224
235
|
| strcat source ":" sourcetype full_source
|
|
225
236
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rouge-lexer-spl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sean Whalen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-03-
|
|
11
|
+
date: 2026-03-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rouge
|
|
@@ -31,6 +31,7 @@ executables: []
|
|
|
31
31
|
extensions: []
|
|
32
32
|
extra_rdoc_files: []
|
|
33
33
|
files:
|
|
34
|
+
- README.md
|
|
34
35
|
- lib/rouge/lexer/spl.rb
|
|
35
36
|
- lib/rouge/lexers/spl.rb
|
|
36
37
|
- spec/demos/spl
|
|
@@ -41,6 +42,8 @@ licenses:
|
|
|
41
42
|
metadata:
|
|
42
43
|
source_code_uri: https://github.com/seanthegeek/rouge-lexer-spl
|
|
43
44
|
bug_tracker_uri: https://github.com/seanthegeek/rouge-lexer-spl/issues
|
|
45
|
+
changelog_uri: https://github.com/seanthegeek/rouge-lexer-spl/blob/main/CHANGELOG.md
|
|
46
|
+
documentation_uri: https://github.com/seanthegeek/rouge-lexer-spl/blob/main/README.md
|
|
44
47
|
post_install_message:
|
|
45
48
|
rdoc_options: []
|
|
46
49
|
require_paths:
|