title: How to modify or add a json field from logstash to work with geo_point in ElasticSearch and Kibana
body: <p>I have a json file with this structure:</p>
  
  <pre><code>{"vhost": "8.8.8.8", "host": "8.8.8.8", "port": 80, "ip": "189.191.116.19", "host.latitude":"40.408599853515625","host.longitude":"-3.692199945449829"}
  </code></pre>
  
  <p>And I have a logstash config file like this: </p>
  
  <pre><code>input {
    stdin {
      type =&gt; "json"
    }
  }
  filter{
      json{
          source =&gt; "message"
      }
  }
  
  output {
          stdout{}
  }
  </code></pre>
  
  <p>I want to transform the json records so that I can use the geo_point type in ES and Kibana. According to the official documentation in 
  <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-geo-point-type.html" rel="nofollow">https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-geo-point-type.html</a> the latitude and longitude fields have to be in a format like this: </p>
  
  <pre><code>"pin" : {
          "location" : {
              "lat" : 41.12,
              "lon" : -71.34
          }
      }
  </code></pre>
  
  <p>My question is, how can I transform from logstash the json input so that I can use the geo_point?. I guess that I can not modify the json structure itself but maybe I can add a new field with the location estructure required by the geo_point type.</p>
  
  <p>Thank you</p>