ELK Kafka JSON to ELK

Source: Internet
Author: User

Logstash Configuration

??

Input {

Kafka {

Zk_connect = "127.0.0.1:2181"

TOPIC_ID = "Cluster"

codec = Plain

Reset_beginning = False

Consumer_threads = 5

Decorate_events = True

}

}

??

??

Output {

If [type]== "Cluster3" or [type]== "Cluster2" or [type]== "Clusterjson"

{

Elasticsearch {

hosts = ["localhost:9200"]

index = "test-kafka-%{type}-%{+yyyy-mm}"

}

}

??

stdout {codec = Rubydebug}

}

??

Server.properties Main Content

Broker.id=0

??

############################# Socket Server Settings #############################

??

listeners=plaintext://:9092

??

# The port the socket server listens on

port=9092

??

??

Server-1.properties Main Content

??

Broker.id=1

??

############################# Socket Server Settings #############################

??

listeners=plaintext://:9093

??

# The port the socket server listens on

port=9093

??

??

Start Kafka,server.properties and Server-1.properties

E:\soft\elk\kafka_2.11-0.9.0.1>bin\windows\kafka-server-start.bat config\custom\server-1.properties

??

Create a topic and view the status

??

??

Find port occupancy and delete a node

??

??

View topic Status

??

??

??

The producer enters the JSON data as follows

??

{"Name": "BULK 7", "Data": 7, "Createtime": "2016-04-05t10:16:22z", "type": "Cluster3"}

??

Kibana 4 shows the following

??

??

??

??

??

??

??

ELK Kafka JSON to ELK

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.