# Not able to Run Logstash .Conf file in ELK 5.4 (Current) Version

**URL:** <https://discuss.elastic.co/t/not-able-to-run-logstash-conf-file-in-elk-5-4-current-version/90476>\
**Category:** Logstash\
**Created:** [June 22, 2017, 2:12pm UTC](https://discuss.elastic.co/t/not-able-to-run-logstash-conf-file-in-elk-5-4-current-version/90476 "2017-06-22T14:12:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pandiyan\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pandiyan_m/32/19404_2.png) [@Pandiyan\_M](https://discuss.elastic.co/u/Pandiyan_M)\
**Post date:** [June 22, 2017, 2:12pm UTC](https://discuss.elastic.co/t/not-able-to-run-logstash-conf-file-in-elk-5-4-current-version/90476/1 "2017-06-22T14:12:23Z")

</div>

Hi,

I have prepared logstash.conf under/etc/logstash/conf.d/filelog.conf as below

```
input {
  file {
    path => "/var/log/file.log"
    codec => json
    start_position => "beginning"
   }
}
filter{

    grok {
      match => ["message", %{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:loglevel} (?<logger>(?:[a-zA-Z0-9]+\.)*[-A-Za-z0-9$]+) %{GREEDYDATA:message}
      overwrite => ["message"]
  }

}
output {
        elasticsearch {
                codec => rubydebug
                host => ['10.141.126.46:9200']
                index => 'filelogs-%{+YYYY.MM.dd}'
        }
}

```

Where my logstash.yml settings are

```
# Which directory should be used by logstash and its plugins
# for any persistent needs. Defaults to LOGSTASH_HOME/data
#
  path.data: /var/lib/logstash

# ------------ Pipeline Configuration Settings --------------
#
# Where to fetch the pipeline configuration for the main pipeline
#
  path.config: /etc/logstash/conf.d

```

I tried to run logstash.conf in different method as below

#Method 1  
bin/logstash -f /etc/logstash/conf.d/filelog.conf  
WARNING: Could not find logstash.yml which is typically located in $LS\_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults  
Could not find log4j2 configuration at path //usr/share/logstash/config/log4j2.properties. Using default config which logs to console  
19:04:25.883 [LogStash::Runner] FATAL logstash.runner - Logstash could not be started because there is already another instance using the configured data directory. If you wish to run multiple instances, you must change the "path.data" setting.

#Method 2  
bin/logstash --path.config /etc/logstash/conf.d/filelog.conf  
WARNING: Could not find logstash.yml which is typically located in $LS\_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults  
Could not find log4j2 configuration at path //usr/share/logstash/config/log4j2.properties. Using default config which logs to console  
19:08:53.683 [LogStash::Runner] FATAL logstash.runner - Logstash could not be started because there is already another instance using the configured data directory. If you wish to run multiple instances, you must change the "path.data" setting.

#method 3

```
 sudo -Hu logstash /usr/share/logstash/bin/logstash --path.settings=/etc/logstash/logstash.yml -t
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path //etc/logstash/logstash.yml/log4j2.properties. Using default config which logs to console
19:35:38.826 [main] FATAL logstash.runner - An unexpected error occurred! {:error=>#<ArgumentError: Path "/usr/share/logstash/data/queue" must be a writable directory. It is not writable.>, :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/settings.rb:433:in `validate'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:216:in `validate_value'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:132:in `validate_all'", "org/jruby/RubyHash.java:1342:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:131:in `validate_all'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:217:in `execute'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:185:in `run'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'", "/usr/share/logstash/lib/bootstrap/environment.rb:71:in `(root)'"]}

```

No luck ☹ Please help me how to run

---

<div class="post-metadata">

**Author:** ![Makra](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Makra](https://discuss.elastic.co/u/Makra)\
**Post date:** [June 23, 2017, 5:30pm UTC](https://discuss.elastic.co/t/not-able-to-run-logstash-conf-file-in-elk-5-4-current-version/90476/2 "2017-06-23T17:30:30Z")

</div>

Hi  
@Pandiyan_M  
There is another instance of logstash is running in your system. Find out the ID of the logstash that is running using `$ ps -aux | grep logstash` and then get rid of it using kill command. You can also use `$ service logstash stop` if it has been already started during the system boot. The third error is due to the permission on the data directory. Change the permission of data directory to 777 using `chmod` command.

---

<div class="post-metadata">

**Author:** ![Pandiyan\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pandiyan_m/32/19404_2.png) [@Pandiyan\_M](https://discuss.elastic.co/u/Pandiyan_M)\
**Post date:** [June 26, 2017, 5:10am UTC](https://discuss.elastic.co/t/not-able-to-run-logstash-conf-file-in-elk-5-4-current-version/90476/3 "2017-06-26T05:10:54Z")

</div>

> [@Makra](#):
>
> ps -aux | grep logstash

```
ps -aux | grep logstash
logstash 12902 13.8 5.0 3767524 404988 ? SNsl 10:35 0:33 /usr/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -Xmx1g -Xms256m -Xss2048k -Djffi.boot.library.path=/usr/share/logstash/vendor/jruby/lib/jni -Xbootclasspath/a:/usr/share/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/usr/share/logstash/vendor/jruby -Djruby.lib=/usr/share/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main /usr/share/logstash/lib/bootstrap/environment.rb logstash/runner.rb --path.settings /etc/logstash
root 12942 0.0 0.0 112648 960 pts/0 S+ 10:39 0:00 grep --color=auto logstash

```

It was running under Logstash uesr account as per process output, but there is no logstash user in my machine, let me know how to kill above one

---

<div class="post-metadata">

**Author:** ![Pandiyan\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pandiyan_m/32/19404_2.png) [@Pandiyan\_M](https://discuss.elastic.co/u/Pandiyan_M)\
**Post date:** [June 26, 2017, 5:24am UTC](https://discuss.elastic.co/t/not-able-to-run-logstash-conf-file-in-elk-5-4-current-version/90476/4 "2017-06-26T05:24:41Z")

</div>

I have stopped logstash services and ran as below

```
    [root@elk-centos logstash]# bin/logstash --path.config /etc/logstash/conf.d/filelog.conf
    WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
    Could not find log4j2 configuration at path //usr/share/logstash/config/log4j2.properties. Using default config which logs to console
    10:50:52.889 [LogStash::Runner] ERROR logstash.agent - Cannot create pipeline {:reason=>"Expected one of #, \", ', -, [, { at line 11, column 29 (byte 167) after filter{\n \n grok { \n match => [ \"message\", "}
    [root@elk-centos logstash]# ls /etc/logstash/
    conf.d jvm.options log4j2.properties logstash.conf logstash.yml startup.options

[root@elk-centos logstash]# ls -ltrh /etc/logstash/
total 28K
-rw-r--r-- 1 root root 1.7K Jun 15 08:34 startup.options
-rw-r--r-- 1 root root 1.4K Jun 15 08:34 log4j2.properties
-rw-r--r-- 1 root root 1.7K Jun 15 08:34 jvm.options
-rw-r--r-- 1 root root 180 Jun 21 17:53 logstash.conf
-rw-r--r-- 1 root root 4.4K Jun 22 19:17 logstash.yml
drwxrwxr-x 2 root root 4.0K Jun 26 10:35 conf.d

```

File is located under same directory and it was root user so no file permission issue. May I know how to solve it

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 26, 2017, 7:23am UTC](https://discuss.elastic.co/t/not-able-to-run-logstash-conf-file-in-elk-5-4-current-version/90476/5 "2017-06-26T07:23:57Z")

</div>

Enclose your grok expression in quotes (single or double).

```
match => ["message", "..."]
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 24, 2017, 7:32am UTC](https://discuss.elastic.co/t/not-able-to-run-logstash-conf-file-in-elk-5-4-current-version/90476/6 "2017-07-24T07:32:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
