<p dir="auto">I'm trying to make a terms facet of an IP address field (with the ip type). It returns numbers, not IP addresses. It works if the type is string. I thought it was fixed in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="585619" data-permission-text="Title is private" data-url="https://github.com/elastic/elasticsearch/issues/678" data-hovercard-type="issue" data-hovercard-url="/elastic/elasticsearch/issues/678/hovercard" href="https://github.com/elastic/elasticsearch/issues/678">#678</a>. I'm using 0.90.3.<br>
The idea is to use Kibana to draw a pie of the top IP addresses in my logs.</p>
<p dir="auto">Terms facet on ip field returns raw integers instead of ip addresses.</p>
<p dir="auto">When asked:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="curl -XGET http://172.16.0.134:9200/nginx-2013.07.12/_search?pretty -d'
{
  &quot;facets&quot;: {
    &quot;pie&quot;: {
      &quot;terms&quot;: {
        &quot;field&quot;: &quot;clientip&quot;,
        &quot;size&quot;: 10,
        &quot;exclude&quot;: []
      },
      &quot;facet_filter&quot;: {
        &quot;fquery&quot;: {
          &quot;query&quot;: {
            &quot;filtered&quot;: {
              &quot;query&quot;: {
                &quot;query_string&quot;: {
                  &quot;query&quot;: &quot;*&quot;
                }
              },
              &quot;filter&quot;: {
                &quot;range&quot;: {
                  &quot;@timestamp&quot;: {
                    &quot;from&quot;: &quot;2013-07-12T12:09:30.122Z&quot;,
                    &quot;to&quot;: &quot;2013-07-12T12:14:30.122Z&quot;
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  &quot;size&quot;: 0
}'"><pre class="notranslate"><code class="notranslate">curl -XGET http://172.16.0.134:9200/nginx-2013.07.12/_search?pretty -d'
{
  "facets": {
    "pie": {
      "terms": {
        "field": "clientip",
        "size": 10,
        "exclude": []
      },
      "facet_filter": {
        "fquery": {
          "query": {
            "filtered": {
              "query": {
                "query_string": {
                  "query": "*"
                }
              },
              "filter": {
                "range": {
                  "@timestamp": {
                    "from": "2013-07-12T12:09:30.122Z",
                    "to": "2013-07-12T12:14:30.122Z"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "size": 0
}'
</code></pre></div>
<p dir="auto">it sais:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;took&quot; : 43,
  &quot;timed_out&quot; : false,
  &quot;_shards&quot; : {
    &quot;total&quot; : 1,
    &quot;successful&quot; : 1,
    &quot;failed&quot; : 0
  },
  &quot;hits&quot; : {
    &quot;total&quot; : 1308357,
    &quot;max_score&quot; : 1.0,
    &quot;hits&quot; : [ ]
  },
  &quot;facets&quot; : {
    &quot;pie&quot; : {
      &quot;_type&quot; : &quot;terms&quot;,
      &quot;missing&quot; : 0,
      &quot;total&quot; : 14220,
      &quot;other&quot; : 7100,
      &quot;terms&quot; : [ {
        &quot;term&quot; : 1472557106,
        &quot;count&quot; : 1727
      }, {
        &quot;term&quot; : 1501212747,
        &quot;count&quot; : 1621
      }, {
        &quot;term&quot; : 1556945832,
        &quot;count&quot; : 1616
      }, {
        &quot;term&quot; : 1498126311,
        &quot;count&quot; : 566
      }, {
        &quot;term&quot; : 1541613928,
        &quot;count&quot; : 438
      }, {
        &quot;term&quot; : 1541613412,
        &quot;count&quot; : 346
      }, {
        &quot;term&quot; : 2488386185,
        &quot;count&quot; : 227
      }, {
        &quot;term&quot; : 3245280414,
        &quot;count&quot; : 208
      }, {
        &quot;term&quot; : 2999036429,
        &quot;count&quot; : 198
      }, {
        &quot;term&quot; : 1299254797,
        &quot;count&quot; : 173
      } ]
    }
  }
}"><pre class="notranslate"><code class="notranslate">{
  "took" : 43,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "hits" : {
    "total" : 1308357,
    "max_score" : 1.0,
    "hits" : [ ]
  },
  "facets" : {
    "pie" : {
      "_type" : "terms",
      "missing" : 0,
      "total" : 14220,
      "other" : 7100,
      "terms" : [ {
        "term" : 1472557106,
        "count" : 1727
      }, {
        "term" : 1501212747,
        "count" : 1621
      }, {
        "term" : 1556945832,
        "count" : 1616
      }, {
        "term" : 1498126311,
        "count" : 566
      }, {
        "term" : 1541613928,
        "count" : 438
      }, {
        "term" : 1541613412,
        "count" : 346
      }, {
        "term" : 2488386185,
        "count" : 227
      }, {
        "term" : 3245280414,
        "count" : 208
      }, {
        "term" : 2999036429,
        "count" : 198
      }, {
        "term" : 1299254797,
        "count" : 173
      } ]
    }
  }
}
</code></pre></div>
<p dir="auto">Mappings:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="curl -XGET http://172.16.0.134:9200/nginx-2013.07.12/_mapping?pretty
{
  &quot;nginx-2013.07.12&quot; : {
    &quot;nginx&quot; : {
      &quot;_all&quot; : {
        &quot;enabled&quot; : false
      },
      &quot;_source&quot; : {
        &quot;compress&quot; : true
      },
      &quot;properties&quot; : {
        &quot;@timestamp&quot; : {
          &quot;type&quot; : &quot;date&quot;,
          &quot;format&quot; : &quot;dateOptionalTime&quot;
        },
        &quot;agent&quot; : {
          &quot;type&quot; : &quot;string&quot;
        },
        &quot;app_id&quot; : {
          &quot;type&quot; : &quot;string&quot;
        },
        &quot;auth&quot; : {
          &quot;type&quot; : &quot;string&quot;
        },
        &quot;bytes&quot; : {
          &quot;type&quot; : &quot;integer&quot;
        },
        &quot;clientip&quot; : {
          &quot;type&quot; : &quot;ip&quot;
        },
        &quot;duration&quot; : {
          &quot;type&quot; : &quot;float&quot;
        },
        &quot;hosting&quot; : {
          &quot;type&quot; : &quot;string&quot;
        },
        &quot;httpversion&quot; : {
          &quot;type&quot; : &quot;string&quot;
        },
        &quot;ident&quot; : {
          &quot;type&quot; : &quot;string&quot;
        },
        &quot;message&quot; : {
          &quot;type&quot; : &quot;string&quot;,
          &quot;index&quot; : &quot;not_analyzed&quot;,
          &quot;omit_norms&quot; : true,
          &quot;index_options&quot; : &quot;docs&quot;
        },
        &quot;physical&quot; : {
          &quot;type&quot; : &quot;string&quot;
        },
        &quot;referrer&quot; : {
          &quot;type&quot; : &quot;string&quot;
        },
        &quot;request&quot; : {
          &quot;type&quot; : &quot;string&quot;
        },
        &quot;request_size&quot; : {
          &quot;type&quot; : &quot;integer&quot;
        },
        &quot;response&quot; : {
          &quot;type&quot; : &quot;integer&quot;
        },
        &quot;source&quot; : {
          &quot;type&quot; : &quot;string&quot;,
          &quot;index&quot; : &quot;not_analyzed&quot;,
          &quot;omit_norms&quot; : true,
          &quot;index_options&quot; : &quot;docs&quot;
        },
        &quot;source_host&quot; : {
          &quot;type&quot; : &quot;string&quot;,
          &quot;index&quot; : &quot;not_analyzed&quot;,
          &quot;omit_norms&quot; : true,
          &quot;index_options&quot; : &quot;docs&quot;
        },
        &quot;source_path&quot; : {
          &quot;type&quot; : &quot;string&quot;,
          &quot;index&quot; : &quot;not_analyzed&quot;,
          &quot;omit_norms&quot; : true,
          &quot;index_options&quot; : &quot;docs&quot;
        },
        &quot;tags&quot; : {
          &quot;type&quot; : &quot;string&quot;,
          &quot;index&quot; : &quot;not_analyzed&quot;,
          &quot;omit_norms&quot; : true,
          &quot;index_options&quot; : &quot;docs&quot;
        },
        &quot;timestamp&quot; : {
          &quot;type&quot; : &quot;date&quot;,
          &quot;format&quot; : &quot;dateOptionalTime&quot;
        },
        &quot;type&quot; : {
          &quot;type&quot; : &quot;string&quot;,
          &quot;index&quot; : &quot;not_analyzed&quot;,
          &quot;omit_norms&quot; : true,
          &quot;index_options&quot; : &quot;docs&quot;
        },
        &quot;verb&quot; : {
          &quot;type&quot; : &quot;string&quot;
        },
        &quot;vhost&quot; : {
          &quot;type&quot; : &quot;string&quot;
        }
      }
    }
  }
}"><pre class="notranslate"><code class="notranslate">curl -XGET http://172.16.0.134:9200/nginx-2013.07.12/_mapping?pretty
{
  "nginx-2013.07.12" : {
    "nginx" : {
      "_all" : {
        "enabled" : false
      },
      "_source" : {
        "compress" : true
      },
      "properties" : {
        "@timestamp" : {
          "type" : "date",
          "format" : "dateOptionalTime"
        },
        "agent" : {
          "type" : "string"
        },
        "app_id" : {
          "type" : "string"
        },
        "auth" : {
          "type" : "string"
        },
        "bytes" : {
          "type" : "integer"
        },
        "clientip" : {
          "type" : "ip"
        },
        "duration" : {
          "type" : "float"
        },
        "hosting" : {
          "type" : "string"
        },
        "httpversion" : {
          "type" : "string"
        },
        "ident" : {
          "type" : "string"
        },
        "message" : {
          "type" : "string",
          "index" : "not_analyzed",
          "omit_norms" : true,
          "index_options" : "docs"
        },
        "physical" : {
          "type" : "string"
        },
        "referrer" : {
          "type" : "string"
        },
        "request" : {
          "type" : "string"
        },
        "request_size" : {
          "type" : "integer"
        },
        "response" : {
          "type" : "integer"
        },
        "source" : {
          "type" : "string",
          "index" : "not_analyzed",
          "omit_norms" : true,
          "index_options" : "docs"
        },
        "source_host" : {
          "type" : "string",
          "index" : "not_analyzed",
          "omit_norms" : true,
          "index_options" : "docs"
        },
        "source_path" : {
          "type" : "string",
          "index" : "not_analyzed",
          "omit_norms" : true,
          "index_options" : "docs"
        },
        "tags" : {
          "type" : "string",
          "index" : "not_analyzed",
          "omit_norms" : true,
          "index_options" : "docs"
        },
        "timestamp" : {
          "type" : "date",
          "format" : "dateOptionalTime"
        },
        "type" : {
          "type" : "string",
          "index" : "not_analyzed",
          "omit_norms" : true,
          "index_options" : "docs"
        },
        "verb" : {
          "type" : "string"
        },
        "vhost" : {
          "type" : "string"
        }
      }
    }
  }
}
</code></pre></div>