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

Source UserAgent as part of the resulting array #21

Open
aramirez-es opened this issue Dec 7, 2015 · 3 comments
Open

Source UserAgent as part of the resulting array #21

aramirez-es opened this issue Dec 7, 2015 · 3 comments

Comments

@aramirez-es
Copy link

Hi guys,

I'm using this plugin in the company I work on, and we have the use case where we need both user agents: parsed and raw ones. We´re solving this issue by adding the raw user Agent as part of the array resulting of applying this plugin:

useragent {
    target => "useragent"
    source => "user_agent"
    add_field => { "[useragent][raw]" => "%{user_agent}" }
}

But, I wonder if this information is useful in other use cases, if so I can send you a pull request to add the raw user agent as part of the parsed array.

Thanks!

@jordansissel
Copy link
Contributor

Given the simplicity of your solution (using add_field), it feels like any alternate solution would be the same level of simplicity (adding one line to your config).

Maybe instead of patching the code, we add this as an example in the docs for this plugin, that if someone wants to store the original useragent text along with the parsed object, we could provide your example. Thoughts?

@aramirez-es
Copy link
Author

Thank @jordansissel for answering,

I was thinking about adding the source user agent once the target Hash is created, without end users to require any action. Anyway you're right, the "solution" is easy enough so that does not require patching the code.

Adding that example to the documentation looks fine to me.

Do you need me to send a pull request?

@jordansissel
Copy link
Contributor

@aramirez-es a pull request for the docs would be lovely :) - the docs for each plugin are as comments within the plugin itself, so adding some comment at the top of the class definition somewhere in this area would be good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants