Drop first x line from my csv log file

Hi, i have a csv log file. and i want to parse and send to ES that file via logstash. But my csv file has 3 lines of comment line. Here the shape of my log

#Version: 15.01.1034.026
#Log-type: Message Tracking Log
#Date: 2018-11-27T17:00:01.234Z
#Fields: csvHeaderColumn1,csvHeaderColumn2

i want to drop first three lines which has start with the # and remove "#Fields"
Actually i can say i want to start my document from csvHeaderColumn1 is there a way to do that with logstash ?

Many thanks

    mutate { gsub => [ "message", "^#Fields: ", "" ] }
    if [message] =~ /^#/ { drop {} }
    csv { autodetect_column_names => true }

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