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

[BUG] Exception in Pipeline Causes Logstash to crash #138

Open
Erni opened this issue Aug 9, 2019 · 0 comments
Open

[BUG] Exception in Pipeline Causes Logstash to crash #138

Erni opened this issue Aug 9, 2019 · 0 comments

Comments

@Erni
Copy link

Erni commented Aug 9, 2019

As an example, with a configuration like this one, we are trying to sanitize our URLs by removing any reference to the value in [@metadata][passwd] in lines like this:

mutate {
      gsub => [ "[location]", "sext2=%{[@metadata][passwd]}", "sext2=xxx" ]
      gsub => [ "[location]", "Password=%{[@metadata][passwd]}", "Password=xxx" ]
      gsub => [ "[location]", "password=%{[@metadata][passwd]}", "password=xxx" ]
    }

The crash bug can be reproduced when the password field contains a [.

To prevent the bug, we have to escape these metacharacters like this:

  mutate {
      gsub => [ "[@metadata][passwd]", "\)", "\\)" ]
      gsub => [ "[@metadata][passwd]", "\(", "\\(" ]
      gsub => [ "[@metadata][passwd]", "\*", "\\*" ]
      ...
    }

The problem is that Logstash crashes instead of just dropping the message.

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

1 participant