bat/assets/syntaxes/02_Extra/syslog.sublime-syntax

64 lines
1.7 KiB
Plaintext
Raw Normal View History

%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: syslog
file_extensions:
- syslog
scope: text.syslog
contexts:
main:
2021-04-05 21:17:47 +02:00
- match: ^(\w+\s+\d+)\s+(\d{2}:\d{2}:\d{2})
scope: meta.datetime.syslog constant.numeric.syslog
2021-04-05 21:17:47 +02:00
captures:
1: meta.date.syslog
2: meta.time.syslog
push: loghost
2021-04-06 22:50:52 +02:00
- match: ^
push: text
loghost:
- match: '[\w-]+'
scope: entity.other.attribute-name.loghost.syslog
set: process
process:
- match: ([\w-]+)(?:(\[)(\d+)(\]))?(:)
captures:
1: support.function.process.syslog
2: punctuation.separator.pid.begin.syslog
3: meta.pid.syslog meta.number.integer.syslog constant.numeric.value.syslog
2021-04-05 21:17:47 +02:00
4: punctuation.separator.pid.end.syslog
5: punctuation.separator.mapping.syslog
set: structured-data
structured-data:
- match: '\['
scope: punctuation.section.mapping.begin.syslog
push:
- match: \]
scope: punctuation.section.mapping.end.syslog
pop: true
- match: \w+
scope: variable.parameter.syslog
- match: =
scope: keyword.operator.assignment.syslog
push:
- match: '[^\s\]]+'
scope: constant.other.syslog
pop: true
- match: (?=\])
pop: true
- match: (?=\S)
set: text
text:
2021-04-06 22:50:52 +02:00
- match: $
pop: true
- match: '<\w+>'
scope: constant.language.syslog
- match: \b(CMD)\b\s+(\()
captures:
1: entity.name.label.syslog
2: punctuation.section.block.begin.syslog
embed: scope:source.shell.bash
2021-04-05 21:17:47 +02:00
escape: \)$
escape_captures:
0: punctuation.section.block.end.syslog
2021-04-06 22:50:52 +02:00
- include: scope:text.log