Closed jangrui closed 1 year ago
interceptors: |
- type: transformer
actions:
- action: copy(fields.containername, server)
- action: copy(fields.namespace, _)
- action: regex(_)
pattern: \S+-(?<env>\S+)-\S+
# access
- if: match(body, (\S+) (\S+) (\S+) (\[.*?\]) \"(.*?) (.*?) (.*?)\" (\S+) (\S+) \"(.*?)\" \"(.*?)\" \"(.*?)\")
then:
- action: regex(body)
pattern: (?<ip>\S+) (?<id>\S+) (?<u>\S+) (?<timestamp>\[.*?\]) \"(?<request_method>.*?) (?<url>.*?) (?<http_version>.*?)\" (?<status>\S+) (?<size>\S+) \"(?<referer>.*?)\" \"(?<agent>.*?)\" \"(?<forwarded>.*?)\"
- action: move(body, message)
# error
- if: match(body, (.*?) (\[.*?\]) (.*)$)
then:
- action: regex(body)
pattern: (?<timestamp>.*?) (?<level>\[.*?\]) (?<log>.*)$
- action: move(body, message)
- type: schema
addMeta:
timestamp:
key: timestamp
How to modify the following configuration