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

mutate gsub filter does not evaluate variables #1529

Closed
tdousset opened this issue Jul 14, 2014 · 1 comment · Fixed by #1552
Closed

mutate gsub filter does not evaluate variables #1529

tdousset opened this issue Jul 14, 2014 · 1 comment · Fixed by #1552
Assignees

Comments

@tdousset
Copy link

Hi,
I have a requirement where I need to strip some data out of the message body of the event. I thought that the mutate - gsub filter would be ideal. When using mutate - gsub the find string does not appear to evaluate %{} variables.

logtype and hostname are collected in an earlier grok pattern.

Event:
"sometype somehost.com Sun Apr 27 19:20:44 2014:"

Example:
mutate {
gsub => [ "message", "sometype somehost.com ", "" ]
}

gives message = "Sun Apr 27 19:20:44 2014:" as desired.

Where
mutate {
gsub => [ "message", "%{logtype} %{hostname} ", "" ]
}

gives the original message unaltered.

I have confirmed that the variables are being filled by using the following:
mutate {
add_field => [ "replace", "%{logtype} %{hostname} ", "" ]
}

"replace" is then equal to "sometype somehost.com " in the case of the example.

@suyograo suyograo self-assigned this Jul 18, 2014
@suyograo suyograo added bug and removed needreview labels Jul 18, 2014
suyograo pushed a commit to suyograo/logstash that referenced this issue Jul 18, 2014
suyograo pushed a commit to suyograo/logstash that referenced this issue Jul 22, 2014
@tdousset
Copy link
Author

Awesome, thanks.

suyograo pushed a commit that referenced this issue Jul 23, 2014
@jordansissel jordansissel added this to the v1.5.0 milestone Nov 11, 2014
alcanzar pushed a commit to alcanzar/logstash that referenced this issue Jun 4, 2015
@tbragin tbragin added the v1.5.0 label Jun 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants