大数据实时日志收集工具logstash 安装

1, 解压文件
安装在 cd /usr/local/

tar -zxvf logstash-6.2.1.tar.gz

2,
配置文件1: simple.conf文件


input {
  stdin {}
}
output {
  stdout {
    codec => rubydebug }
}

配置文件1:运行输出

[root@localhost config]# ../bin/logstash -f  simple.conf
hello
world
Sending Logstash's logs to /usr/local/logstash-6.3.2/logs which is now configured via log4j2.properties
[2018-08-30T11:55:33,463][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2018-08-30T11:55:33,949][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"6.3.2"}
[2018-08-30T11:55:36,606][INFO ][logstash.pipeline        ] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>40, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}
[2018-08-30T11:55:36,711][INFO ][logstash.pipeline        ] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x5d5a5912 run>"}
The stdin plugin is now waiting for input:
[2018-08-30T11:55:36,824][INFO ][logstash.agent           ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2018-08-30T11:55:37,240][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600}
{
          "host" => "localhost.localdomain",
      "@version" => "1",
       "message" => "hello",
    "@timestamp" => 2018-08-30T03:55:36.761Z
}
{
          "host" => "localhost.localdomain",
      "@version" => "1",
       "message" => "world",
    "@timestamp" => 2018-08-30T03:55:36.810Z
}

配置文件2: simple2.conf

input {
    file {
        path =>"/usr/local/logstash-6.3.2/logstash_data/data.txt"
        start_position => "beginning"
    }
}

output {
    file {
        path => "/usr/local/logstash-6.3.2/logstash_data/data_out.txt"
        gzip => false
    }
}

配置文件2:运行输出

--一个窗口运行
echo ' xxxx' >>  data.txt

--另一个窗口看输出数据 

tail -f logstash_data/data_out.tx

配置文件3


input {
  stdin {}
}


output {
    file {
        path => "/usr/local/logstash-6.3.2/logstash_data/testlog"
        gzip => false
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值