|
|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
|
" Vim syntax file
|
|
|
|
|
" Language: Generic log file
|
|
|
|
|
" Maintainer: MTDL9 <https://github.com/MTDL9>
|
|
|
|
|
" Latest Revision: 2019-04-16
|
|
|
|
|
" Latest Revision: 2020-08-23
|
|
|
|
|
|
|
|
|
|
if exists('b:current_syntax')
|
|
|
|
|
finish
|
|
|
|
|
@@ -13,7 +13,7 @@ set cpoptions&vim
|
|
|
|
|
|
|
|
|
|
" Operators
|
|
|
|
|
"---------------------------------------------------------------------------
|
|
|
|
|
syn match logOperator display '[;,\?\:\.\<=\>\~\/\@\&\!$\%\&\+\-\|\^(){}\*#]'
|
|
|
|
|
syn match logOperator display '[;,\?\:\.\<=\>\~\/\@\!$\%&\+\-\|\^(){}\*#]'
|
|
|
|
|
syn match logBrackets display '[\[\]]'
|
|
|
|
|
syn match logEmptyLines display '-\{3,}'
|
|
|
|
|
syn match logEmptyLines display '\*\{3,}'
|
|
|
|
|
@@ -43,15 +43,16 @@ syn region logString start=/'\(s \|t \| \w\)\@!/ end=/'/ end=/$/ end=/s / s
|
|
|
|
|
syn match logDate '\d\{2,4}[-\/]\(\d\{2}\|Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\)[-\/]\d\{2,4}T\?'
|
|
|
|
|
" Matches 8 digit numbers at start of line starting with 20
|
|
|
|
|
syn match logDate '^20\d\{6}'
|
|
|
|
|
" Matches Fri Jan 09 or Feb 11 or Apr 3
|
|
|
|
|
syn match logDate '\(\(Mon\|Tue\|Wed\|Thu\|Fri\|Sat\|Sun\) \)\?\(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\) [0-9 ]\d'
|
|
|
|
|
" Matches Fri Jan 09 or Feb 11 or Apr 3 or Sun 3
|
|
|
|
|
syn keyword logDate Mon Tue Wed Thu Fri Sat Sun Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec nextgroup=logDateDay
|
|
|
|
|
syn match logDateDay '\s\{1,2}\d\{1,2}' contained
|
|
|
|
|
|
|
|
|
|
" Matches 12:09:38 or 00:03:38.129Z or 01:32:12.102938 +0700
|
|
|
|
|
syn match logTime '\d\{2}:\d\{2}:\d\{2}\(\.\d\{2,6}\)\?\(\s\?[-+]\d\{2,4}\|Z\)\?\>' nextgroup=logTimeZone,logSysColumns skipwhite
|
|
|
|
|
|
|
|
|
|
" Follows logTime, matches UTC or PDT 2019 or 2019 EDT
|
|
|
|
|
syn match logTimeZone '\(UTC\|PDT\|EDT\|GMT\|EST\|KST\)\( \d\{4}\)\?' contained
|
|
|
|
|
syn match logTimeZone '\d\{4} \(UTC\|PDT\|EDT\|GMT\|EST\|KST\)' contained
|
|
|
|
|
syn match logTimeZone '[A-Z]\{2,5}\>\( \d\{4}\)\?' contained
|
|
|
|
|
syn match logTimeZone '\d\{4} [A-Z]\{2,5}\>' contained
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Entities
|
|
|
|
|
@@ -64,7 +65,7 @@ syn match logIPV4 '\<\d\{1,3}\(\.\d\{1,3}\)\{3}\>'
|
|
|
|
|
syn match logIPV6 '\<\x\{1,4}\(:\x\{1,4}\)\{7}\>'
|
|
|
|
|
syn match logMacAddress '\<\x\{2}\(:\x\{2}\)\{5}'
|
|
|
|
|
syn match logFilePath '\<\w:\\[^\n|,; ()'"\]{}]\+'
|
|
|
|
|
syn match logFilePath '\/\w[^\n|,; ()'"\]{}]\+'
|
|
|
|
|
syn match logFilePath '[^a-zA-Z0-9"']\@<=\/\w[^\n|,; ()'"\]{}]\+'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Syslog Columns
|
|
|
|
|
@@ -85,7 +86,7 @@ syn match logXmlAttribute contained "\(\n\|\s\)\(\(\w\|-\)\+:\)\?\(\w\|-\)\+\
|
|
|
|
|
syn match logXmlNamespace contained "\(\w\|-\)\+:" contains=logOperator
|
|
|
|
|
syn region logXmlComment start=/<!--/ end=/-->/
|
|
|
|
|
syn match logXmlCData /<!\[CDATA\[.*\]\]>/
|
|
|
|
|
syn match logXmlEntity /\&\w\+;/
|
|
|
|
|
syn match logXmlEntity /&#\?\w\+;/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Levels
|
|
|
|
|
@@ -112,6 +113,7 @@ hi def link logNull Constant
|
|
|
|
|
hi def link logString String
|
|
|
|
|
|
|
|
|
|
hi def link logDate Identifier
|
|
|
|
|
hi def link logDateDay Identifier
|
|
|
|
|
hi def link logTime Function
|
|
|
|
|
hi def link logTimeZone Identifier
|
|
|
|
|
|
|
|
|
|
|