Draw Bash script output with Kibana

625 views Asked by At

I am doing a basic url chek by using CURL. I have my Kibana, Elasticsearch and filebeat installed. I am able to see logs in Kibana. So kibana can read /var/log/kibana.customized.jt.log

[Here is my Kibana screen 1

However when I want to visualize my data there are no such columns. In future I will use logstash so I will need to write som grok {} filter.

For now I assume I need to write som kind of "index" or so... to be able ploting simpe X,Y chart with http respones on Y axis and timestamp on X asis

If needed I will change my log format - it is not a problem.

Could anyone help with that.

for i in {1..50} ; do awk 'BEGIN {"date +'%Y.%m.%d-%T'"|getline d;"curl -sI ip.ip.ip.ip/" | getline; printf "{\"timestampx\": \"%s\", \"statusx\": \"%s\"}\n", d, $2}' >> /var/log/kibana.customized.jt.log; sleep 1; done

cat /var/log/kibana.customized.jt.log
...
{"timestampx": "2016.12.13-11:47:51", "statusx": "200"}
{"timestampx": "2016.12.13-11:47:52", "statusx": "200"}
{"timestampx": "2016.12.13-11:47:53", "statusx": "200"}
{"timestampx": "2016.12.13-11:47:54", "statusx": "200"}
{"timestampx": "2016.12.13-11:47:55", "statusx": "200"}
{"timestampx": "2016.12.13-11:47:56", "statusx": "200"}
{"timestampx": "2016.12.13-11:47:57", "statusx": "200"}
{"timestampx": "2016.12.13-11:47:58", "statusx": "200"}
{"timestampx": "2016.12.13-11:47:59", "statusx": "200"}
{"timestampx": "2016.12.13-11:48:00", "statusx": "200"}
...
0

There are 0 answers