Skip to content

Commit

Permalink
move message_regex_parser next to glogs_parser_router because that is…
Browse files Browse the repository at this point in the history
… where it is used
  • Loading branch information
Joseph Sirianni committed Feb 2, 2021
1 parent 05e27bc commit a9acf69
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions plugins/kubernetes_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,24 @@ pipeline:
- output: message_regex_parser
expr: '$record.message matches "^\\w\\d{4}"'

# message field seems to match expected format.
- id: message_regex_parser
type: regex_parser
parse_from: message
regex: '(?P<severity>\w)(?P<timestamp>\d{4} \d{2}:\d{2}:\d{2}.\d+)\s+(?P<pid>\d+)\s+(?P<src>[^:]*):(?P<src_line>[^\]]*)\] (?P<message>.*)'
severity:
parse_from: severity
mapping:
debug: d
info: i
warning: w
error: e
critical: c
timestamp:
parse_from: timestamp
layout: '%m%d %H:%M:%S.%s'
output: {{ .output }}

# Use journald to gather kubelet logs. Use provided path for journald if available otherwise use default locations.
- id: kubelet_reader
type: journald_input
Expand Down Expand Up @@ -220,24 +238,6 @@ pipeline:
debug: 7
output: {{ .output }}

# message field seems to match expected format.
- id: message_regex_parser
type: regex_parser
parse_from: message
regex: '(?P<severity>\w)(?P<timestamp>\d{4} \d{2}:\d{2}:\d{2}.\d+)\s+(?P<pid>\d+)\s+(?P<src>[^:]*):(?P<src_line>[^\]]*)\] (?P<message>.*)'
severity:
parse_from: severity
mapping:
debug: d
info: i
warning: w
error: e
critical: c
timestamp:
parse_from: timestamp
layout: '%m%d %H:%M:%S.%s'
output: {{ .output }}

# kubelet logs come from journald with UTC timestamps,
# so we ignore the timestamp given in the glog message because
# it is known to have the wrong time zone (host's timzone)
Expand Down

0 comments on commit a9acf69

Please sign in to comment.