title: logstash and elasticsearch geo_point
body: <p>I am using logstash to input geospatial data from a csv into elasticsearch as geo_points.</p>
  
  <p>The CSV looks like the following:</p>
  
  <pre><code>$ head -5 geo_data.csv
  "lon","lat","lon2","lat2","d","i","approx_bearing"
  -1.7841,50.7408,-1.7841,50.7408,0.982654,1,256.307
  -1.7841,50.7408,-1.78411,50.7408,0.982654,1,256.307
  -1.78411,50.7408,-1.78412,50.7408,0.982654,1,256.307
  -1.78412,50.7408,-1.78413,50.7408,0.982654,1,256.307
  </code></pre>
  
  <p>I have create a mapping template that looks like the following:</p>
  
  <pre><code>$ cat map_template.json
  
  {
    "template": "base_map_template",
    "order":    1,
    "settings": {
      "number_of_shards": 1
    },
      {
        "mappings": {
          "base_map": {
            "properties": {
              "lon2": { "type" : "float" },
              "lat2": { "type" : "float" },
              "d": { "type" : "float" },
              "appox_bearing": { "type" : "float" },
              "location": { "type" : "geo_point" }
            }
          }
        }
      }
  }
  </code></pre>
  
  <p>My config file for logstash has been set up as follows:</p>
  
  <pre><code>$ cat map.conf
  
  input {
    stdin {}
  }
  
  filter {
    csv {
        columns =&gt; [
          "lon","lat","lon2","lat2","d","i","approx_bearing"
        ]
    }
  
    if [lon] == "lon" {
        drop { }
    } else {
        mutate {
            remove_field =&gt; [ "message", "host", "@timestamp", "@version" ]
        }
  
        mutate {
            convert =&gt; { "lon" =&gt; "float" }
            convert =&gt; { "lat" =&gt; "float" }
            convert =&gt; { "lon2" =&gt; "float" }
            convert =&gt; { "lat2" =&gt; "float" }
            convert =&gt; { "d" =&gt; "float" }
            convert =&gt; { "i" =&gt; "integer"}
            convert =&gt; { "approx_bearing" =&gt; "float"}
        }
  
        mutate {
            rename =&gt; {
                "lon" =&gt; "[location][lon]"
                "lat" =&gt; "[location][lat]"
            }
        }
    }
  }
  
  output {
  #  stdout { codec =&gt; rubydebug }
    stdout { codec =&gt; dots }
    elasticsearch {
        index =&gt; "base_map"
        template =&gt; "map_template.json"
        document_type =&gt; "node_points"
        document_id =&gt; "%{i}"
    }
  }
  </code></pre>
  
  <p>I then try and use logstash to input the csv data into elasticsearch as geo_points using the following command:</p>
  
  <pre><code>$ cat geo_data.csv | logstash-2.1.3/bin/logstash -f map.conf
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Settings: Default filter workers: 16
  Unexpected character ('{' (code 123)): was expecting double-quote to start field name
  at [Source: [B@278e55d1; line: 7, column: 3]{:class=&gt;"LogStash::Json::ParserError", :level=&gt;:error}
  Logstash startup completed
  ....Logstash shutdown completed
  </code></pre>
  
  <p>What am I missing?</p>