配置与运行logstash
代码语言:javascript复制[root@h102 etc]# /opt/logstash/bin/logstash -f logstash-filebeat-es-simple.conf -t
Configuration OK
[root@h102 etc]# cat logstash-filebeat-es-simple.conf
input {
stdin{}
beats{port => 5044}
}
output {
elasticsearch {
hosts=>"localhost:9200"
index=>"%{[@metadata][beat]}-%{ YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
}
stdout {codec=>rubydebug}
}
[root@h102 etc]# /opt/logstash/bin/logstash -f logstash-filebeat-es-simple.conf
Settings: Default filter workers: 1
Logstash startup completed
...
...
查看端口信息
代码语言:javascript复制[root@h102 ~]# netstat -ant | grep 5044
tcp 0 0 :::5044 :::* LISTEN
[root@h102 ~]# lsof -i :5044
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 3518 root 5u IPv6 26614 0t0 TCP *:lxi-evntsvc (LISTEN)
[root@h102 ~]# pstree -ap 3518
java,3518 -XX: UseParNewGC -XX: UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75-XX: UseCMSIniti
├─{java},3535
├─{java},3536
├─{java},3537
├─{java},3538
├─{java},3539
├─{java},3540
├─{java},3541
├─{java},3542
├─{java},3543
├─{java},3544
├─{java},3545
├─{java},3546
├─{java},3547
├─{java},3548
├─{java},3550
├─{java},3551
├─{java},3553
├─{java},3554
├─{java},3555
├─{java},3556
├─{java},3557
└─{java},3558
[root@h102 ~]#
[root@h102 ~]# ps -faux |grep 3518
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root 3577 0.0 0.0 103256 828 pts/2 S 22:58 0:00 | _ grep 3518
root 3518 12.9 9.5 2516488 183444 pts/3 Sl 22:53 0:36 _ /usr/bin/java -XX: UseParNewGC -XX: UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX: UseCMSInitiatingOccupancyOnly -XX: HeapDumpOnOutOfMemoryError -Xmx1g -Xss2048k -Djffi.boot.library.path=/opt/logstash/vendor/jruby/lib/jni -XX: UseParNewGC -XX: UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX: UseCMSInitiatingOccupancyOnly -XX: HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/logstash/heapdump.hprof -Xbootclasspath/a:/opt/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/opt/logstash/vendor/jruby -Djruby.lib=/opt/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main --1.9 /opt/logstash/lib/bootstrap/environment.rb logstash/runner.rb agent -f logstash-filebeat-es-simple.conf
[root@h102 ~]#