Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

logstash tab separator not escaping

I have tab separated data which I want to input into logstash. Here is my configuration file:

input {
    file {
        path => "/*.csv"
        type => "testSet"
        start_position => "beginning"
    }
}

filter {
    csv {
        separator => "\t"
    }
}

output {
    stdout {
        codec => rubydebug
    }
}

It simply looks for all .csv files and separates them using tabs. For an input like this:

col1    col2
data1    data2

logstash output is (for the two rows):

column1 => "col1\tcol2"
column1 => "data1\tdata2"

Obviously it is not correctly parsing it. I saw that this issue was brought up a while ago here but there was no solution. Does anyone know if this problem has been resolved or maybe there's another way to do it? Thanks!

like image 569
Noah Santacruz Avatar asked Jun 18 '15 12:06

Noah Santacruz


1 Answers

Instead of using "\t" as the seperator, input an actual tab. like this:

filter {
   csv {
    separator => "  "
   }
}
like image 80
Roman Avatar answered Oct 17 '22 20:10

Roman