@@ -0,0 +1,70 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: syslog
5+file_extensions:
6+ - syslog
7+scope: text.syslog
8+contexts:
9+ main:
10+ - match: '^\w+\s+\d+\s+\d{2}:\d{2}:\d{2}'
11+ scope: meta.datetime.syslog constant.numeric.syslog
12+ push: loghost
13+ loghost:
14+ - match: '[\w-]+'
15+ scope: entity.other.attribute-name.loghost.syslog
16+ set: process
17+ process:
18+ - match: ([\w-]+)(?:(\[)(\d+)(\]))?(:)
19+ captures:
20+ 1: support.function.process.syslog
21+ 2: punctuation.separator.pid.begin.syslog
22+ 3: meta.pid.syslog meta.number.integer.syslog constant.numeric.value.syslog
23+ 4: punctuation.separator.mapping.syslog
24+ set: structured-data
25+ structured-data:
26+ - match: '\['
27+ scope: punctuation.section.mapping.begin.syslog
28+ push:
29+ - match: \]
30+ scope: punctuation.section.mapping.end.syslog
31+ pop: true
32+ - match: \w+
33+ scope: variable.parameter.syslog
34+ - match: =
35+ scope: keyword.operator.assignment.syslog
36+ push:
37+ - match: '[^\s\]]+'
38+ scope: constant.other.syslog
39+ pop: true
40+ - match: (?=\])
41+ pop: true
42+ - match: (?=\S)
43+ set: text
44+ text:
45+ - match: (\w+)(=)
46+ captures:
47+ 1: variable.parameter.syslog
48+ 2: keyword.operator.assignment.syslog
49+ - match: (')([^']*)(')
50+ scope: string.quoted.single.syslog
51+ captures:
52+ 1: punctuation.definition.string.begin.syslog
53+ 3: punctuation.definition.string.end.syslog
54+ - match: (")([^"]*)(")
55+ scope: string.quoted.double.syslog
56+ captures:
57+ 1: punctuation.definition.string.begin.syslog
58+ 3: punctuation.definition.string.end.syslog
59+ - match: \d+
60+ scope: meta.number.integer.syslog constant.numeric.value.syslog
61+ - match: \b(CMD)\b\s+(\()
62+ captures:
63+ 1: entity.name.label.syslog
64+ 2: punctuation.section.block.begin.syslog
65+ embed: scope:source.shell.bash
66+ escape: \)
67+ escape_captures:
68+ 0: punctuation.section.block.end.syslog
69+ - match: $
70+ pop: true