elk中kibana中如何显示写入elasticsearch的数据

写入es的数据语句如下所示:

curl -H "Content-Type: application/json" -XPOST 'http://192.168.32.137:9200/system-syslog-20181129/system-syslog' -d '{"first_name":"yuan","last_name":"mu","age":88,"about":"I love to wo qu","interests":["sport","huangya"]}'

查询es数据的语句如下所示:

curl -XGET 'http://192.168.32.137:9200/system-syslog-20181129/system-syslog/_search?q=age:88'

需要在kibana图形界面做配置,手动搞一些东西,如下所示:

elk中kibana中如何显示写入elasticsearch的数据_第1张图片

新建的kibana报错如下所示:
In order to visualize and explore data in Kibana, you'll need to create an index pattern to retrieve data from Elasticsearch.
No default index pattern. You must select or create one to continue.

新建的kibana索引文件如下所示:

[root@localhost bin]# vim /etc/logstash/conf.d/syslog.conf

input {  # 定义日志源

  syslog {

    type => "system-syslog"  # 定义类型

    port => 10514    # 定义监听端口

  }

}
output {  # 定义日志输出
  elasticsearch {

    hosts => ["192.168.32.137:9200","192.168.32.138:9200","192.168.32.134:9200"]

    index => "system-syslog-%{+YYYY.MM.dd}"

  }

}
 

你可能感兴趣的:(elk/splunk,elasticsearch)