Make sure you installed ELK stack and all services are running
root@elk-1-vm:~# netstat -tlpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 991/sshd
tcp 0 0 127.0.0.1:5601 0.0.0.0:* LISTEN 3831/node
tcp6 0 0 :::9300 :::* LISTEN 4371/java
tcp6 0 0 :::5044 :::* LISTEN 3095/java
tcp6 0 0 :::22 :::* LISTEN 991/sshd
tcp6 0 0 :::8888 :::* LISTEN 3095/java
tcp6 0 0 :::443 :::* LISTEN 2207/httpd.bin
tcp6 0 0 127.0.0.1:9600 :::* LISTEN 3095/java
tcp6 0 0 :::9200 :::* LISTEN 4371/java
tcp6 0 0 :::80 :::* LISTEN 2207/httpd.bin
tcp6 0 0 :::5010 :::* LISTEN 3095/java
{
-
name: “Pjpt-5r”,
-
cluster_name: “elasticsearch”,
-
cluster_uuid: “WW_jGXvlRMm2DvUwBdyjag”,
-
version:
{
-
number: “6.2.3”,
-
build_hash: “c59ff00”,
-
build_date: “2018-03-13T10:06:29.741383Z”,
-
build_snapshot: false,
-
lucene_version: “7.2.1”,
-
minimum_wire_compatibility_version: “5.6.0”,
-
minimum_index_compatibility_version: “5.0.0”,
},
-
-
tagline: “You Know, for Search”,
https://www.elastic.co/guide/en/kibana/6.x/tutorial-load-dataset.html#tutorial-load-dataset
root@elk-1-vm:~# wget https://download.elastic.co/demos/kibana/gettingstarted/shakespeare_6.0.json
–2018-04-03 04:10:42– https://download.elastic.co/demos/kibana/gettingstarted/shakespeare_6.0.json
Resolving download.elastic.co (download.elastic.co)… 54.235.82.130, 184.72.242.47, 184.73.245.233, …
Connecting to download.elastic.co (download.elastic.co)|54.235.82.130|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 25327465 (24M) [application/json]
Saving to: ‘shakespeare_6.0.json’
shakespeare_6.0.json 100%[=============================================>] 24.15M 32.4MB/s in 0.7s
2018-04-03 04:10:43 (32.4 MB/s) – ‘shakespeare_6.0.json’ saved [25327465/25327465]
https://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html#tutorial-load-dataset
root@elk-1-vm:~# curl -XPUT ‘localhost:9200/shakespeare?pretty’ -H ‘Content-Type: application/json’ -d’
{
“mappings”: {
“doc”: {
“properties”: {
“speaker”: {“type”: “keyword”},
“play_name”: {“type”: “keyword”},
“line_id”: {“type”: “integer”},
“speech_number”: {“type”: “integer”}
}
}
}
}
‘
{
“acknowledged” : true,
“shards_acknowledged” : true,
“index” : “shakespeare”
}
Or same can be done with PUT from DevTools Tab in kibana DashBoard
PUT /shakespeare { "mappings": { "doc": { "properties": { "speaker": {"type": "keyword"}, "play_name": {"type": "keyword"}, "line_id": {"type": "integer"}, "speech_number": {"type": "integer"} } } } }
root@elk-1-vm:~# curl -H ‘Content-Type: application/x-ndjson’ -XPOST ‘localhost:9200/shakespeare/doc/_bulk?pretty’ –data-binary @shakespeare_6.0.json
.
.
.
.
{
“index” : {
“_index” : “shakespeare”,
“_type” : “doc”,
“_id” : “111395”,
“_version” : 1,
“result” : “created”,
“_shards” : {
“total” : 2,
“successful” : 1,
“failed” : 0
},
“_seq_no” : 22453,
“_primary_term” : 1,
“status” : 201
}
}
]
}
Data in devtool tab
######################
GET _search
{
“query”: {
“match_all”: {}
}
}
###########################
GET /_cat/indices?v
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open .kibana kA6-jhNPQKSVXvjf2IqeTg 1 0 2 0 12.7kb 12.7kb
yellow open logstash-2018.04.03 X5mD6OsYQsu6NXEDvaw51g 5 1 1 0 9.8kb 9.8kb
yellow open shakespeare FpMIBV0FRsO-DNb8jgezNg 5 1 111396 0 21.9mb 21.9mb