1125
|
1 " Vim syntax file
|
|
2 " Language: /var/log/messages file
|
|
3 " Maintainer: Yakov Lerner <iler.ml@gmail.com>
|
1668
|
4 " Latest Revision: 2008-06-29
|
|
5 " Changes: 2008-06-29 support for RFC3339 tuimestamps James Vega
|
1125
|
6
|
|
7 if exists("b:current_syntax")
|
|
8 finish
|
|
9 endif
|
|
10
|
|
11 let s:cpo_save = &cpo
|
|
12 set cpo&vim
|
|
13
|
1668
|
14 syn match messagesBegin display '^' nextgroup=messagesDate,messagesDateRFC3339
|
1125
|
15
|
|
16 syn match messagesDate contained display '\a\a\a [ 0-9]\d *'
|
|
17 \ nextgroup=messagesHour
|
|
18
|
|
19 syn match messagesHour contained display '\d\d:\d\d:\d\d\s*'
|
|
20 \ nextgroup=messagesHost
|
|
21
|
1668
|
22 syn match messagesDateRFC3339 contained display '\d\{4}-\d\d-\d\d'
|
|
23 \ nextgroup=messagesRFC3339T
|
|
24
|
|
25 syn match messagesRFC3339T contained display '\cT'
|
|
26 \ nextgroup=messagesHourRFC3339
|
|
27
|
|
28 syn match messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)'
|
|
29 \ nextgroup=messagesHost
|
|
30
|
1125
|
31 syn match messagesHost contained display '\S*\s*'
|
|
32 \ nextgroup=messagesLabel
|
|
33
|
|
34 syn match messagesLabel contained display '\s*[^:]*:\s*'
|
|
35 \ nextgroup=messagesText contains=messagesKernel,messagesPID
|
|
36
|
|
37 syn match messagesPID contained display '\[\zs\d\+\ze\]'
|
|
38
|
|
39 syn match messagesKernel contained display 'kernel:'
|
|
40
|
|
41
|
|
42 syn match messagesIP '\d\+\.\d\+\.\d\+\.\d\+'
|
|
43
|
|
44 syn match messagesURL '\w\+://\S\+'
|
|
45
|
|
46 syn match messagesText contained display '.*'
|
|
47 \ contains=messagesNumber,messagesIP,messagesURL,messagesError
|
|
48
|
|
49 syn match messagesNumber contained '0x[0-9a-fA-F]*\|\[<[0-9a-f]\+>\]\|\<\d[0-9a-fA-F]*'
|
|
50
|
|
51 syn match messagesError contained '\c.*\<\(FATAL\|ERROR\|ERRORS\|FAILED\|FAILURE\).*'
|
|
52
|
|
53
|
|
54 hi def link messagesDate Constant
|
|
55 hi def link messagesHour Type
|
1668
|
56 hi def link messagesDateRFC3339 Constant
|
|
57 hi def link messagesHourRFC3339 Type
|
|
58 hi def link messagesRFC3339T Normal
|
1125
|
59 hi def link messagesHost Identifier
|
|
60 hi def link messagesLabel Operator
|
|
61 hi def link messagesPID Constant
|
|
62 hi def link messagesKernel Special
|
|
63 hi def link messagesError ErrorMsg
|
|
64 hi def link messagesIP Constant
|
|
65 hi def link messagesURL Underlined
|
|
66 hi def link messagesText Normal
|
|
67 hi def link messagesNumber Number
|
|
68
|
|
69 let b:current_syntax = "messages"
|
|
70
|
|
71 let &cpo = s:cpo_save
|
|
72 unlet s:cpo_save
|