Short tutorial how to get started with kibana on OSX for rookies (like me at this topic)
- elasitcsearch
- kibana4
on the shell start bin/elasticsearch
and bin/kibana
- elasticsearch will listen on: http://localhost:9200
- kibana will listen on: http://localhost:5601
Data must be imported to elasticsearch. On Kibana you must point to the index (in RDBM term index = database) on which kibana shall work elasticsearch works great with json files, but to import you have to tweak the json that it is conform to elasticsearch's bulk format.
There are two ways:
- if you import your data with curl and specify the index (=database) and type (=collection) on the request, then you can use en empty action-line
- if you import your data with curl and do not specify index and type, you have to specify ist on the action-line
recipies.json (bulk format, mind the linebreak: \n
at the end of each line):
{ "index": {}}
{"recipe":"French fries","condiment":"potatoes, salt, oil","perparation":"cut potatoes to chips, heat oil in chip pan, put chips into oil, when ready fetch chips and add salt"}
{ "index": {}}
{"recipe":"Yum fries","condiment":"potatoes, salt, oil","perparation":"cut yum to chips, heat oil in chip pan, put chips into oil, when ready fetch chips and add salt"}
curl -XPOST 'localhost:9200/chef/cooking/_bulk?pretty' --data-binary @recipies.json
Mind that chef is the index (= database) and cooking the type (= collection)
If something went wrong or you have to clean up the index, then run the following command to delete the index:
curl -XDELETE 'http://localhost:9200/chef'
In the browser or via curl
localhost:9200/_cat/indices?v
This show all indexes in elasticsearch with the amount of documents
In the browser or via curl. I had the problem that some integers where recognized as strings instead of numbers
http://localhost:9200/chef/_mapping
Changing mappings is not directly possible. There are some workarounds. Otherwise you can create the index with correct mappings and import the data again.
As german dates are not english once, its possible to specify the date format
Open kibana in your webbrowser http://localhost:5601. Tell kibana to use the index chef and that you are not using the time-based-thing.
If you click on Discover you get your chef/cooking data presented and can start to dig/configure around.