Issue of Configuring in Logstash

This is the configuration in logstash-sample.conf:

input{
	stdin{}      
}
output{
        elasticsearch{
                hosts => ["localhost:9200"]
                index => "my-index-name"
		user => "elastic"
		password => "changeme"
        }
        file{
                path => "/etc/logstash/conf.d/logstash-sample-output"
    }
       stdout {

	 }
}


This is the configuration in the pipeline.conf file:

- pipeline.id: main
  path.config: "/etc/logstash/conf.d/*.conf"

When I run this command:

/usr/share/logstash/bin/logstash -f logstash-sample.conf

This is the log:

The expected output which is the index name is (my-index-name)
should be reflected in Kibana Dashboard Index Management:

How to resolve this issue?

Hi,

The log says another logstash sharing the same "path.data" setting.

1 Like

Hello! This is our logstash.yml file:
image

There may be two ways.

  1. change the path.data, or
  2. stop another logstash instance using the same path.data path.
1 Like

Hello, I run this command to pass path.setting:

/usr/share/logstash/bin/logstash  --path.settings /etc/logstash/ -f logstash-sample.conf 

and this is the log:

Your log is saying that you have another logstash running in your server, you need to check that and stopped the other instance.

1 Like

ps -aux | grep "logstash" Will show running instances.

You should make it as a systemd service or try a init / kill script that catch the PID.

1 Like

Hello @grumo35 , Thank you issue is resolved!!!
Steps:

  1. Show running instances.
ps -aux | grep logstash
  1. Kill running instances.
Kill -9 <PID>

Additional Information:
You could pass the path.settings in the CLI with this command:

/usr/share/logstash/bin/logstash  --path.settings /etc/logstash/ -f logstash-sample.conf 
1 Like