Skip to content

ELK Stack

Johnson Fu edited this page Aug 10, 2019 · 5 revisions

ELK Stack

Elasticsearch

download

https://www.elastic.co/downloads/elasticsearch

after start up, access http://localhost:9200/ to check for the health

simple http post testing to add the document

for example, post to /product/book/1 with json body, where product is the index, book is the type, 1 is the key

{
	"name" : "dim sum",
	"type" : "food",
	"postDate" : "2019-08-10",
	"message" : "this is a testing"
}

elasticsearch will return it is successful to create the document

{
   "_index": "product",
   "_type": "book",
   "_id": "1",
   "_version": 1,
   "result": "created",
   "_shards":    {
      "total": 2,
      "successful": 1,
      "failed": 0
   },
   "_seq_no": 0,
   "_primary_term": 1
}

use http get to retrieve the data

{
   "_index": "product",
   "_type": "book",
   "_id": "1",
   "_version": 1,
   "_seq_no": 0,
   "_primary_term": 1,
   "found": true,
   "_source":    {
      "name": "dim sum",
      "type": "food",
      "postDate": "2019-08-10",
      "message": "this is a testing"
   }
}

use /product/book/_search for the searching

{
	"query" : {
		"match": {
			"message" : "this"
		}
	}
}

Log Analysis

ELK 教學 - 從無到有安裝 ELK (CentOS/Red Hat) https://blog.johnwu.cc/article/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-centos-red-hat.html

  • freemarker
  • thymeleaf
  • JMX (jconsole)
  • ZeroMQ
  • microk8s
  • multipass
  • pwsh (powershell)

Clone this wiki locally