zoukankan      html  css  js  c++  java
  • ELK Kafka json to elk

    Logstash配置

       

    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 主要内容

    broker.id=0

       

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

       

    listeners=PLAINTEXT://:9092

       

    # The port the socket server listens on

    port=9092

       

       

    Server-1.properties 主要内容

       

    broker.id=1

       

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

       

    listeners=PLAINTEXT://:9093

       

    # The port the socket server listens on

    port=9093

       

       

    启动kafka,server.properties和server-1.properties

    E:softelkkafka_2.11-0.9.0.1>binwindowskafka-server-start.bat configcustomserver-1.properties

       

    创建topic,并查看状态

       

       

    查找端口占用情况,并删除一个节点

       

       

    查看 topic状态

       

       

       

    生产者输入json数据,如下

       

    {"Name":"BULK 7","Data":7,"CreateTime":"2016-04-05T10:16:22Z","type":"cluster3"}

       

    Kibana 4显示如下

       

       

       

       

       

       

       

  • 相关阅读:
    P1361 小M的作物 【网络流】【最小割】
    餐巾计划问题 【网络流24题】【费用流】【zkw】
    P1231 教辅的组成 【网络流】【最大流】
    Rikka with coin 思维题
    线段树模板新
    AC自动机 洛谷P3966 单词
    AC自动机 洛谷P5357 模板
    AC自动机 洛谷P3796
    AC自动机 洛谷P3808 模板
    KMP 洛谷P3375
  • 原文地址:https://www.cnblogs.com/liuyuhua/p/5356293.html
Copyright © 2011-2022 走看看