简体   繁体   English

当作为服务运行时,Logstash不会将数据发送到弹性搜索

[英]Logstash not sending data to elastic search when ran as a service

This is my config file stored at /etc/logstash/conf 这是我的配置文件存储在/ etc / logstash / conf中

input
{
file{
path => ["PATH_OF_FILE"]
}
}

output
{
elasticsearch
{
host => "172.29.86.35"
index => "new"
}
}

and this is my elasticsearch.yaml file content for network and http 这是我的elasticsearch.yaml文件内容,适用于网络和http

\# Set the bind address specifically (IPv4 or IPv6):

\#network.bind_host: 172.29.86.35

\# Set the address other nodes will use to communicate with this node. If not
\# set, it is automatically derived. It must point to an actual IP address.
\#network.publish_host: 192.168.0.1

\# Set both 'bind_host' and 'publish_host':
network.host: 172.29.86.35

\# Set a custom port for the node to node communication (9300 by default):
\#transport.tcp.port: 9300

\# Enable compression for all communication between nodes (disabled by default):

\#transport.tcp.compress: true

\# Set a custom port to listen for HTTP traffic:
\#http.port: 9200

I am running elasticsearch and logstash as service.The problem is when I start log stash as a service it does not send any data to elasticsearch. 我正在运行elasticsearch和logstash作为服务。问题是当我作为服务启动日志存储时,它不会向elasticsearch发送任何数据。 However if I use the same config in the logstash conf file and run logstash from the CLI it works perfectly fine. 但是,如果我在logstash conf文件中使用相同的配置并从CLI运行logstash,则它可以正常工作。 Even the logs do not show any error. 即使是日志也不会显示任何错误。

The version I am running is 1.4.3 for ES and 1.4.2 for LS. 我运行的版本是ES为1.4.3,LS为1.4.2。 The system env is RHEL 7 系统环境是RHEL 7

I also have encountered same issue... When I exec command using -f option, it works normally, but when I start service, nothing happen and log file under /etc/log stash never updated. 我也遇到了同样的问题...当我使用-f选项执行命令时,它正常工作,但是当我启动服务时,没有任何反应,并且/ etc / log stash下的日志文件永远不会更新。

What I did as the temporary counter measure is to exec the command below(with & option) 我作为临时对策做的是执行下面的命令(带&选项)

Logstash if conffile.conf &

With this, it work even if I logout from server. 有了这个,即使我从服务器注销也能工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM