Hi Badger,
Your question gave me a hint. my input was exec plugin with command as cat of the file. resulting in such an output. I changed to below, and now it works fine.
input{
file
{
path => "/etc/logstash/temp_data"
start_position => "beginning"
}
}
However, my original problem statement was to run command every interval and capture the output of the command
output of my command looks like the data in my previous question (as below). So i started debugging by adding into file and checking. So please help me how can i achieve the same output with exec command
Hi,
With below logstash conf, i am now able to get the job done, except that the drop filter isn't working (drop lines which do not contain "APP" string). Can you please help me with this
If your command outputs multiple lines then the exec input will join them together into a single message. A split filter can be used to separate each line into its own event...
Hi Badger,
i see some difference when input reads from file and when we use exec command. with file input, each line is read in message and processed through the filter and so my output looks as expected. See below:
But when i exec my command, which gives similar lines, the message has all the lines with '\n' character as one string. And so my output isn't as expected (see below). Is there a way i can have exec command output also be read line by line?
Hola!!
just when i posted this question i resolved the issue with simple split in the filter plugin at the start before kv plugin. initially i tried split but passing some arguments in it. but seems to work without any arguments.
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.