How to parse csv using logstash

I have CSV files where columns are in following sequence-->

File1: A,B,C,D
File2: A,C,D,B

I have to parse only A and B columns. how to map this and push to ES.

I am not sure about the sequence of columns in the Third file, however the columns A and B be persisting in the file. I have to pick A and B. IS there any way?

With CSV filter you need to define columns. but in case of many files where sequence is not sure how to extract specific columns by just names.

Look at the auto detection options.

But you will probably have an option only keeping two columns and removing all others. Logstash will let you remove things, but you need to know the names.

What is auto detection options. please elaborate.

I know the names which i can remove any time.

Have a look at

1 Like

Do you mean "autodetect_column_names"?

Thanks I will give a try. Thank you very much.

Hi @Saket_Kumar,

Can you send one log sample ? so i know that exactly what you want.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.