Creating Dummy Entry via ConfigFile


#1

Hi everyone,

I just started the basic dummy entry creation with stdin via:

$ sudo docker exec -it <container-name> /bin/bash

and

# /opt/logstash/bin/logstash --path.data /tmp/logstash/data \
    -e 'input { stdin { } } output { elasticsearch { hosts => ["localhost"] } }'

But when i put this code:

input { stdin { } } output { elasticsearch { hosts => ["localhost"] } }

into a file named, stdinconfig.conf

and call the same command with

# /opt/logstash/bin/logstash --path.data /tmp/logstash/data \
    -e  stdinconfig.conf

i get an error message:

Cannot create pipeline {:reason=>"Expected one of #, input, filter, output at line 1, column 1 (byte 1) after "}

I checked if I have a byte order mark at the beginning with via :setlocal bomb? and it returned nobomb. so thats not the problem.

So where's the problem? Any ideas?
thanks in advance.

EDIT:
solved by myself, I had to use -f instead of -e


(Paris Mermigkas) #2

The -e flag is for loading a config string, as per your first example. In order to pass a config file you have to use -f instead.


(system) #3

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