Logstash 基础4

2022-02-10 20:29:55 浏览数 (2)

pretty 参数,可以使输出更清晰

查来自 Buffalo

代码语言:javascript复制
[root@h102 ~]# curl -XGET 'localhost:9200/logstash-2015.12.23/_search?q=geoip.city_name=Buffalo&pretty'
{
  "took" : 4,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 1,
    "max_score" : 1.0520113,
    "hits" : [ {
      "_index" : "logstash-2015.12.23",
      "_type" : "logs",
      "_id" : "AVHPFlOg70zKhyBEHGi1",
      "_score" : 1.0520113,
      "_source":{"message":"108.174.55.234 - - [04/Jan/2015:05:27:45  0000] "GET /?flav=rss20 HTTP/1.1" 200 29941 "-" "-"","@version":"1","@timestamp":"2015-12-23T13:45:22.929Z","host":"h102.temp","path":"/root/logstash/logstash-tutorial.log","clientip":"108.174.55.234","ident":"-","auth":"-","timestamp":"04/Jan/2015:05:27:45  0000","verb":"GET","request":"/?flav=rss20","httpversion":"1.1","response":"200","bytes":"29941","referrer":""-"","agent":""-"","geoip":{"ip":"108.174.55.234","country_code2":"US","country_code3":"USA","country_name":"United States","continent_code":"NA","region_name":"NY","city_name":"Buffalo","postal_code":"14221","latitude":42.9864,"longitude":-78.7279,"dma_code":514,"area_code":716,"timezone":"America/New_York","real_region_name":"New York","location":[-78.7279,42.9864]}}
    } ]
  }
}
[root@h102 ~]# 

0 人点赞