关于logstash 机制问题
在官方上有几个例子
http://logstash.net/docs/1.1.0/tutorials/10-minute-walkthrough/
其中如下命令
java -jar logstash-1.1.0-monolithic.jar agent -f hello-search.conf -- web --backend elasticsearch:///?local
可以将其内嵌的JETTY服务启动起来
Mizuno 0.5.0 (Jetty 8.0.y.z-SNAPSHOT) listening on 0.0.0.0:9292
目前还不是很了解elasticsearch是怎么使用的,我指定的服务器,及我产生的LOG4J的日志文件又是如何导入其中,并通过页面查看?
其中官方有个例子
input {
tcp {
type => "apache"
port => 3333
}
}filter {
grok {
type => "apache"
# See the following URL for a complete list of named patterns
# logstash/grok ships with by default:
# https://github.com/logstash/logstash/tree/master/patterns
#
# The grok filter will use the below pattern and on successful match use
# any captured values as new fields in the event.
pattern => "%{COMBINEDAPACHELOG}"
}date {
type => "apache"
# Try to pull the timestamp from the 'timestamp' field (parsed above with
# grok). The apache time format looks like: "18/Aug/2011:05:44:34 -0700"
timestamp => "dd/MMM/yyyy:HH
如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

评论(7)


现在可以买本书了,书名叫《实战Elasticsearch Logstash Kibana--分布式大数据搜索与日志挖》
你也可以看官网帮助:
https://www.elastic.co/guide/en/logstash/current/index.html
这是在产生日志机器上logstash的配置:
input {
file {
type => "voip_log"
path => ["/usr1/app/logs/voip_server.log"]
path => ["/home/jfy/tmp/test*.log"]
sincedb_path => "/home/jfy/soft/logstash-1.4.2/sincedb.access"
start_position => "beginning"
#record logfile track to file
}
}
#filter {
# grep {
# match => [ "@message", "mysql|GET|error" ]
# }
#}
output {
redis {
host => '172.16.18.116'
data_type => 'list'
key => 'logstash:redis'
batch => true
batch_events => 100
#workers => 5
}
# elasticsearch {
# #embedded => true
# host => "172.16.18.116"
# }
}
发布评论
需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。