-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add dissect to traefik/access metricset for first stage of processing #7209
Conversation
28c2bd3
to
e633b6a
Compare
"field": "traefik.access.message", | ||
"patterns": [ | ||
"\"%{WORD:traefik.access.method} %{DATA:traefik.access.url} HTTP/%{NUMBER:traefik.access.http_version}\" %{NUMBER:traefik.access.response_code} (?:%{NUMBER:traefik.access.body_sent.bytes}|-)( \"%{DATA:traefik.access.referrer}\")?( \"%{DATA:traefik.access.agent}\")?(?:%{NUMBER:traefik.access.request_count}|-)?( \"%{DATA:traefik.access.frontend_name}\")?( \"%{DATA:traefik.access.backend_url}\")?" | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you cold extract that information too :
"\"%{WORD:traefik.access.method} %{DATA:traefik.access.url} HTTP/%{NUMBER:traefik.access.http_version}\" %{NUMBER:traefik.access.response_code}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. The nicest part here is that it makes it even more readable.
- dissect: | ||
tokenizer: '%{traefik.access.remote_ip} - %{traefik.access.user_name} [%{traefik.access.time}] | ||
"%{traefik.access.method} %{traefik.access.url} HTTP/%{traefik.access.http_version}" | ||
%{traefik.access.response_code} %{traefik.access.message}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruflin I think this is a good first step, after looking at the complete if dissect was support chaining of tokenizer we could probably extract everything with 2 dissect processor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @ruflin I am ok to merge this since we have tests covering it up and it makes the extraction simpler and probably faster.
@ph Yes, this is mainly to showcase dissect and demo how grok and dissect can be combined and not meant to replace grok. Want me to rebase or squash or you do it directly? |
@ruflin even if its a refactor should we create a changelog entry to make it more visible? |
This should provide an example use case on how grok and dissect can be combined. The resulting outcome should be identical. The main difference is that now some of the fields can be used on the Beats side for filtering out events.
Changelog added for visibility. |
This should provide an example use case on how grok and dissect can be combined. The resulting outcome should be identical. The main difference is that now some of the fields can be used on the Beats side for filtering out events.