简体   繁体   中英

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

This is my config file stored at /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

\# 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. However if I use the same config in the logstash conf file and run logstash from the CLI it works perfectly fine. 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. The system env is 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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