input {
#    exec {
#        command => "cat /Users/robertmetthe/projects/test.json"
#        codec => "json"
#        interval => 3600
#    }
    file {
        #path => "/Users/robertmetthe/projects/crime.csv"
        path => "/Users/nreese/projects/denver_data/crime.csv"
        start_position => "beginning"
        sincedb_path => "/dev/null"
        ignore_older => 0
        type => "report"
    }
}

filter {
    csv {
        columns => [
        "INCIDENT_ID",
        "OFFENSE_ID",
        "OFFENSE_CODE",
        "OFFENSE_CODE_EXTENSION",
        "OFFENSE_TYPE_ID",
        "OFFENSE_CATEGORY_ID",
        "FIRST_OCCURRENCE_DATE",
        "LAST_OCCURRENCE_DATE",
        "REPORTED_DATE",
        "INCIDENT_ADDRESS",
        "GEO_X",
        "GEO_Y",
        "GEO_LON",
        "GEO_LAT",
        "DISTRICT_ID",
        "PRECINCT_ID",
        "NEIGHBORHOOD_ID",
        "IS_CRIME",
        "IS_TRAFFIC"
        ]
        separator => ","
    }

    mutate {
      convert => { "GEO_LON" => "float" }
      convert => { "GEO_LAT" => "float" }
      convert => { "IS_CRIME" => "boolean" }
      convert => { "IS_TRAFFIC" => "boolean" }
    }

    mutate {
      add_field => {
        "[location][lat]" => "%{GEO_LAT}"
        "[location][lon]" => "%{GEO_LON}"
      }
      remove_field => ["GEO_LAT", "GEO_LON", "GEO_X", "GEO_Y", "path", "host", "message"]
    }

    ruby {
       code => "
         event['FIRST_OCCURRENCE_DATE'][10] = 'T'
         event['FIRST_OCCURRENCE_DATE'] = event['FIRST_OCCURRENCE_DATE'] + '.000'
       "
    }
    #2015-01-27 00:04:59
}

output {
    stdout {
        codec => rubydebug
    }
    elasticsearch {
        #http://localhost:9200/_cat/indices
        #http://localhost:9200/denver_crime/_mapping?pretty=true
        #http://localhost:9200/denver_crime/_search?pretty=true
        index => "denver_crime"
    }
}

@@ -1381,25 +1381,24 @@
 uby %7B%0A      
- 
 code =%3E %22%0A  
@@ -1395,16 +1395,69 @@
 de =%3E %22%0A
+        if (event%5B'FIRST_OCCURRENCE_DATE'%5D != nil) %0A 
         
@@ -1498,16 +1498,17 @@
 %5D = 'T'%0A
+ 
         
@@ -1580,16 +1580,315 @@
 + '.000'
+%0A%0A          hours = Integer(event%5B'FIRST_OCCURRENCE_DATE'%5D%5B11..12%5D, 10)%0A          mins = Integer(event%5B'FIRST_OCCURRENCE_DATE'%5D%5B14..15%5D, 10)%0A          secs = Integer(event%5B'FIRST_OCCURRENCE_DATE'%5D%5B17..18%5D, 10)%0A          %0A          event%5B'secsOfDay'%5D = (hours * 3600) + (mins * 60) + secs%0A        end
 %0A       
@@ -1936,16 +1936,17 @@
 t %7B%0A    
+#
 stdout %7B
@@ -1946,24 +1946,25 @@
 tdout %7B%0A    
+#
     codec =%3E
@@ -1974,24 +1974,25 @@
 bydebug%0A    
+#
 %7D%0A    elasti

add secsOfDay field