0

I have csv file that has types column with array of integers in format:

id,date,state,types,x,y
14518263,2021-01-01 20:20:00,2,"18,19,63,72",14.46154,50.07164

Could someone help me with converting types column into array via filter in pipeline?

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Dec 20, 2021 at 9:54

2 Answers 2

1

So I feel you need two steps for this.

You will be using 2 mutation filter to do so.

filter {
    mutate {
        split => { "<your field name>" => "," }
    }
    mutate {
        convert => { "<your field name>" => "integer" }
    }
}

For reference there was a discussion going on here

Sign up to request clarification or add additional context in comments.

Comments

0

You need to use two filter for this, First, you need to split it into string array based on the splitter or seperator then you need to convert it to desired data type here integer

mutate {
        split => { "field1" => "," }
        split => { "field2" => "," }
    }enter code here
    mutate {
        convert => { "field1" => "integer" }
        convert => { "field2" => "integer" }

  

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.