-
Notifications
You must be signed in to change notification settings - Fork 1.8k
conf: Convert existing parser*.conf files to yaml, add converter, add tests #11168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hlein
wants to merge
7
commits into
fluent:master
Choose a base branch
from
hlein:parsers-yaml
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e05405d
conf: parser_custom.conf: remove leading whitespace, fix parse error
hlein 8a12573
conf: parser: added a reference to a test-case for syslog-rfc3164
hlein 375079e
conf: parser: Convert all http://rubular.com/ links to https://
hlein d0b9e59
tests: config_format: Add converter and tests for parser .conf -> .yaml
hlein 85e1ccc
conf: parser: Add YAML versions of all existing conf/parser*conf files
hlein f9507ef
docs: examples: multiline: convert examples from conf to yaml
hlein ee5a9ae
config_format: Add parser*.yaml references alongside parser*.conf
hlein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| Daemon Off | ||
| Log_Level info | ||
| Parsers_File parsers.conf | ||
| #Parsers_File parsers.yaml | ||
|
|
||
| [INPUT] | ||
| Name tail | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| Daemon Off | ||
| Log_Level info | ||
| Parsers_File parsers.conf | ||
| #Parsers_File parsers.yaml | ||
|
|
||
| [INPUT] | ||
| Name tail | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| parsers: | ||
| - name: rabbitmq | ||
| # https://rubular.com/r/6ZCuwV4Xa7nfA3 | ||
| format: regex | ||
| regex: (?<date>[^ ]+)\s(?<time>[^ ]+)\s\[(?<log_level>[^ \]]*)\]\s(?<PID>[^ ]*)\s(?<msg>((([a-zA-Z]*\s+)+[^ ]*)+)+) | ||
|
|
||
| - name: neo4j | ||
| # https://rubular.com/r/jWfJIOMKr2LgcO | ||
| format: regex | ||
| regex: (?<date>[^ ]*) (?<time>[^ ]*) (?<log_level>[^ ]*)\s(?<msg>([^ ]*\s+[^ ]*)+) | ||
|
|
||
| - name: external-dns | ||
| # https://rubular.com/r/U8VbByp0oRPLU6 | ||
| format: regex | ||
| regex: ([^ ])\"(?<time>[^ ]+)\"\s([^ ]+)\=(?<log_level>[.+a-zA-Z]+)\s([^ ]+)\"(?<msg>([^ ]*\s+[^ ]*\s[a-zA-Z0-9]*)+) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| parsers: | ||
| - name: apache | ||
| format: regex | ||
| regex: '^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$' | ||
| time_key: time | ||
| time_format: '%d/%b/%Y:%H:%M:%S %z' | ||
|
|
||
| - name: apache2 | ||
| format: regex | ||
| regex: '^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>.*)")?$' | ||
| time_key: time | ||
| time_format: '%d/%b/%Y:%H:%M:%S %z' | ||
|
|
||
| - name: apache_error | ||
| format: regex | ||
| regex: '^\[[^ ]* (?<time>[^\]]*)\] \[(?<level>[^\]]*)\](?: \[pid (?<pid>[^\]]*)\])?( \[client (?<client>[^\]]*)\])? (?<message>.*)$' | ||
|
|
||
| - name: nginx | ||
| format: regex | ||
| regex: '^(?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")' | ||
| time_key: time | ||
| time_format: '%d/%b/%Y:%H:%M:%S %z' | ||
|
|
||
| - name: k8s-nginx-ingress | ||
| # https://rubular.com/r/IhIbCAIs7ImOkc | ||
| format: regex | ||
| regex: '^(?<host>[^ ]*) - (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*) "(?<referer>[^\"]*)" "(?<agent>[^\"]*)" (?<request_length>[^ ]*) (?<request_time>[^ ]*) \[(?<proxy_upstream_name>[^ ]*)\] (\[(?<proxy_alternative_upstream_name>[^ ]*)\] )?(?<upstream_addr>[^ ]*) (?<upstream_response_length>[^ ]*) (?<upstream_response_time>[^ ]*) (?<upstream_status>[^ ]*) (?<reg_id>[^ ]*).*$' | ||
| time_key: time | ||
| time_format: '%d/%b/%Y:%H:%M:%S %z' | ||
|
|
||
| - name: json | ||
| format: json | ||
| time_key: time | ||
| time_format: '%d/%b/%Y:%H:%M:%S %z' | ||
|
|
||
| - name: logfmt | ||
| format: logfmt | ||
|
|
||
| - name: docker | ||
| format: json | ||
| time_key: time | ||
| time_format: '%Y-%m-%dT%H:%M:%S.%L' | ||
| time_keep: On | ||
| # -- | ||
| # Since Fluent Bit v1.2, if you are parsing Docker logs and using | ||
| # the Kubernetes filter, it's not longer required to decode the | ||
| # 'log' key. | ||
| # | ||
| # Command | Decoder | Field | Optional Action | ||
| # =============|==================|================= | ||
| #Decode_Field_As json log | ||
| # | ||
|
|
||
| - name: docker-daemon | ||
| format: regex | ||
| regex: time="(?<time>[^ ]*)" level=(?<level>[^ ]*) msg="(?<msg>[^ ].*)" | ||
| time_key: time | ||
| time_format: '%Y-%m-%dT%H:%M:%S.%L' | ||
| time_keep: On | ||
|
|
||
| - name: syslog-rfc5424 | ||
| format: regex | ||
| regex: ^\<(?<pri>[0-9]{1,5})\>1 (?<time>[^ ]+) (?<host>[^ ]+) (?<ident>[^ ]+) (?<pid>[-0-9]+) (?<msgid>[^ ]+) (?<extradata>(\[(.*?)\]|-)) (?<message>.+)$ | ||
| time_key: time | ||
| time_format: '%Y-%m-%dT%H:%M:%S.%L%z' | ||
| time_keep: On | ||
|
|
||
| - name: syslog-rfc3164-local | ||
| format: regex | ||
| regex: '^\<(?<pri>[0-9]+)\>(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$' | ||
| time_key: time | ||
| time_format: '%b %d %H:%M:%S' | ||
| time_keep: On | ||
|
|
||
| - name: syslog-rfc3164 | ||
| format: regex | ||
| regex: '/^\<(?<pri>[0-9]+)\>(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<host>[^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$/' | ||
| time_key: time | ||
| time_format: '%b %d %H:%M:%S' | ||
| time_keep: On | ||
|
|
||
| - name: mongodb | ||
| format: regex | ||
| regex: '^(?<time>[^ ]*)\s+(?<severity>\w)\s+(?<component>[^ ]+)\s+\[(?<context>[^\]]+)]\s+(?<message>.*?) *(?<ms>(\d+))?(:?ms)?$' | ||
hlein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| time_format: '%Y-%m-%dT%H:%M:%S.%L' | ||
| time_keep: On | ||
| time_key: time | ||
|
|
||
| - name: envoy | ||
| # https://rubular.com/r/0VZmcYcLWMGAp1 | ||
| format: regex | ||
| regex: '^\[(?<start_time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)? (?<protocol>\S+)" (?<code>[^ ]*) (?<response_flags>[^ ]*) (?<bytes_received>[^ ]*) (?<bytes_sent>[^ ]*) (?<duration>[^ ]*) (?<x_envoy_upstream_service_time>[^ ]*) "(?<x_forwarded_for>[^ ]*)" "(?<user_agent>[^\"]*)" "(?<request_id>[^\"]*)" "(?<authority>[^ ]*)" "(?<upstream_host>[^ ]*)"' | ||
| time_format: '%Y-%m-%dT%H:%M:%S.%L%z' | ||
| time_keep: On | ||
| time_key: start_time | ||
|
|
||
| - name: istio-envoy-proxy | ||
| # https://rubular.com/r/hbsTIxFFMozLmh | ||
| format: regex | ||
| regex: '^\[(?<start_time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)? (?<protocol>\S+)" (?<response_code>[^ ]*) (?<response_flags>[^ ]*) (?<response_code_details>[^ ]*) (?<connection_termination_details>[^ ]*) "(?<upstream_transport_failure_reason>[^ ]*)" (?<bytes_received>[^ ]*) (?<bytes_sent>[^ ]*) (?<duration>[^ ]*) (?<x_envoy_upstream_service_time>[^ ]*) "(?<x_forwarded_for>[^ ]*)" "(?<user_agent>[^\"]*)" "(?<x_request_id>[^\"]*)" "(?<authority>[^ ]*)" "(?<upstream_host>[^ ]*)" (?<upstream_cluster>[^ ]*) (?<upstream_local_address>[^ ]*) (?<downstream_local_address>[^ ]*) (?<downstream_remote_address>[^ ]*) (?<requested_server_name>[^ ]*) (?<route_name>[^ ]*)$' | ||
| time_format: '%Y-%m-%dT%H:%M:%S.%L%z' | ||
| time_keep: On | ||
| time_key: start_time | ||
|
|
||
| - name: cri | ||
| # https://rubular.com/r/tjUt3Awgg4 | ||
| format: regex | ||
| regex: ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>[^ ]*) (?<message>.*)$ | ||
| time_key: time | ||
| time_format: '%Y-%m-%dT%H:%M:%S.%L%z' | ||
| time_keep: On | ||
|
|
||
| - name: kube-custom | ||
| format: regex | ||
| regex: '(?<tag>[^.]+)?\.?(?<pod_name>[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64})\.log$' | ||
|
|
||
| - name: kmsg-netfilter-log | ||
| # Examples: TCP: https://rubular.com/r/Q8YY6fHqlqwGI0 UDP: https://rubular.com/r/B0ID69H9FvN0tp | ||
| format: regex | ||
| regex: '^\<(?<pri>[0-9]{1,5})\>1 (?<time>[^ ]+) (?<host>[^ ]+) kernel - - - \[[0-9\.]*\] (?<logprefix>[^ ]*)\s?IN=(?<in>[^ ]*) OUT=(?<out>[^ ]*) MAC=(?<macsrc>[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}):(?<macdst>[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}):(?<ethtype>[0-9a-f]{2}:[0-9a-f]{2}) SRC=(?<saddr>[^ ]*) DST=(?<daddr>[^ ]*) LEN=(?<len>[^ ]*) TOS=(?<tos>[^ ]*) PREC=(?<prec>[^ ]*) TTL=(?<ttl>[^ ]*) ID=(?<id>[^ ]*) (D*F*)\s*PROTO=(?<proto>[^ ]*)\s?((SPT=)?(?<sport>[0-9]*))\s?((DPT=)?(?<dport>[0-9]*))\s?((LEN=)?(?<protolen>[0-9]*))\s?((WINDOW=)?(?<window>[0-9]*))\s?((RES=)?(?<res>0?x?[0-9]*))\s?(?<flag>[^ ]*)\s?((URGP=)?(?<urgp>[0-9]*))' | ||
| time_key: time | ||
| time_format: '%Y-%m-%dT%H:%M:%S.%L%z' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Ambassador - open source Kubernetes-native API gateway for microservices built on the Envoy Proxy https://www.getambassador.io | ||
| # | ||
|
|
||
| parsers: | ||
| - name: ambassador | ||
| format: regex | ||
| regex: '^(?<type>\S+) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>(?:[^\"]|\\.)*?)(?: +\S*)?) (?<protocol>\S+)?" (?<response_code>\S+) (?<response_flags>\S+) (?<bytes_received>\S+) (?<bytes_sent>\S+) (?<duration>\S+) (?<x_envoy_upstream_service_time>\S+) "(?<x_forwarded_for>[^\"]*)" "(?<user_agent>[^\"]*)" "(?<x_request_id>[^\"]*)" "(?<authority>[^\"]*)" "(?<upstream_host>[^\"]*)"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| parsers: | ||
| - name: ceph | ||
| # https://rubular.com/r/IvZVElTgNl | ||
| format: regex | ||
| regex: '^(?<log_time>[^ ][-.\d\+:T]+[ ]*[.:\d]*)\s+(?<message>.*)$' | ||
| time_format: '%Y-%m-%d %H:%M:%S.%L' | ||
| time_keep: Off | ||
| time_key: log_time | ||
hlein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.