Skip to content
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

Merged
merged 1 commit into from
Jun 1, 2018

Conversation

ruflin
Copy link
Contributor

@ruflin ruflin commented May 30, 2018

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.

@ruflin ruflin added in progress Pull request is currently in progress. module review Filebeat Filebeat blocked and removed blocked in progress Pull request is currently in progress. labels May 30, 2018
@ruflin ruflin force-pushed the traefik-dissect branch 2 times, most recently from 28c2bd3 to e633b6a Compare May 30, 2018 18:59
"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}\")?"
],
Copy link
Contributor

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} 

Copy link
Contributor Author

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}'
Copy link
Contributor

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.

Copy link
Contributor

@ph ph left a 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.

@ruflin
Copy link
Contributor Author

ruflin commented Jun 1, 2018

@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?

@ph
Copy link
Contributor

ph commented Jun 1, 2018

@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.
@ruflin ruflin force-pushed the traefik-dissect branch from 1f435df to 06c4c76 Compare June 1, 2018 12:09
@ruflin
Copy link
Contributor Author

ruflin commented Jun 1, 2018

Changelog added for visibility.

@ph ph merged commit 9cfdd96 into elastic:master Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants