title: Selective parsing of csv file using logstash
body: <p>I am trying to feed data into elasticsearch from csv files, through logstash. These csv files contain the first row as the column names. Is there any particular way to skip that row while parsing the file? Are there any conditionals/filters that I could use such that in case of exception it would skip to the next row??</p>
  
  <p>my config file looks like:</p>
  
  <pre><code>input {  
        file {
            path =&gt; "/home/sagnik/work/logstash-1.4.2/bin/promosms_dec15.csv"
            type =&gt; "promosms_dec15"
            start_position =&gt; "beginning"
            sincedb_path =&gt; "/dev/null"
        }
  }
  filter {
  
      csv {
          columns =&gt; ["Comm_Plan","Queue_Booking","Order_Reference","Generation_Date"]
          separator =&gt; ","
      }  
      ruby {
            code =&gt; "event['Generation_Date'] = Date.parse(event['Generation_Date']);"
      }
  
  }
  output {  
      elasticsearch { 
          action =&gt; "index"
          host =&gt; "localhost"
          index =&gt; "promosms-%{+dd.MM.YYYY}"
          workers =&gt; 1
      }
  }
  </code></pre>
  
  <p>The first few rows of my csv file looks like</p>
  
  <pre><code>"Comm_Plan","Queue_Booking","Order_Reference","Generation_Date"
  "","No","FMN1191MVHV","31/03/2014"
  "","No","FMN1191N64G","31/03/2014"
  "","No","FMN1192OPMY","31/03/2014"
  </code></pre>
  
  <p>Is there anyway I could skip the first line? Also, if my csv file ends with a new line, with nothing in it, then also I get an error. How do I skip those new lines if they come at the end of the file or if thre is an empty row between 2 rows?</p>