I have a logstash running in a virtual box Centos system and purpose is for collecting a log file and parsing and sending it to elasticsearch in my other machine in a virtual box.
I get <> not reachable , retrying connection, maximum retry time out.... kind of errors.
output {
if "openvas" in [tags] {
elasticsearch {
hosts => [ "192.168.56.50:9200" ]
index => "logstash-vulnwhisperer-%{+YYYY.MM}"
}
}
}
** My firewalls in both the machines are off
** I am able to ping the IPs from both machines
** i did not do any changes in logstash.yml file
*** I have a a logstash running in my elasticsearch machine and I am able to ingest different logs through that logstash with output as localhost:9200. so my elasticsearch is working fine.
Kindly guide me on what basic things i am missing. is it a configuration issue ?
Hello @A_B - I get connection refused error when i do curl. my elastic server/VM is up and running. even other logstash in the elastic server is running and am getting logs in kibana.
as said earlier firewall is disabled in both Vms.
@A_B IP of logstash VM is 192.168.56.50
if in case i want to use file beat to collect logs and send to logstash that is running in other VM - will i have same problem ? just to try .
and the log i want is in json format. xxx.json . can i collect json using file beat and use codec=json in logstash filter ?
Quite possibly... Anything you do over the network will have to have correct connectivity to work.
If ping works between your VMs, you might get some more info for troubleshooting by using some sort of port scanner. E.g. nmap.
One thing to test is also if Elasticsearch is only listening on localhost. E.g. lsof -n -P -i :9200 will show you what is listening on port 9200 and on which network interface. If it is 127.0.0.1 you will have to change (or add) network.host: 192.165.56.10 to your elasticsearch.yaml.
Hello @A_B Thank you very much. I changed network.host to my elasticsearch vm IP and connectivity issue is resolved.
Just to add - changing network.host in elasticsearch.yml file caused kibana to break. So needed to change the elastiocsearch IP from localhost to VM IP in kibana.yml file as well.
Same with logstash conf file - output filter doesnt support localhost:9200 it required <>
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.