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

Wrong split example in official documents #130

Open
hjfeng1988 opened this issue Jan 19, 2019 · 1 comment
Open

Wrong split example in official documents #130

hjfeng1988 opened this issue Jan 19, 2019 · 1 comment

Comments

@hjfeng1988
Copy link

link:https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-split

Example:

filter {
    mutate {
        split => ["hostname", "."]
        add_field => { "shortHostname" => "%{hostname[0]}" }
    }

    mutate {
        rename => ["shortHostname", "hostname" ]
    }
}

In this example,split's input type is a list,But it must a hash

@tbennett6421
Copy link

tbennett6421 commented Jul 12, 2019

I'd like to add that older documentation is incorrect.

Per 6.5 documentation, split takes a hash

filter {
  mutate {
     split => { "fieldname" => "," }
  }
}

this is incorrect and throws a logstash error. It takes a list as input

filter {
  mutate {
     split => [ "fieldname", "," ]
  }
}

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