How can I receive path from another file in logstash?


input {
path =>pipe{command => "cat /home/xyz/Logstash/logstash_logstashconf/directories.csv"}

////////////////////// Content inside directories.csv /////////////////////////

But, this does not work..
Is there any other way???

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Replay ASAP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

To answer this question we need to understand why you want to do this. What's your end goal? Why can't you store the filename or filename pattern in the Logstash configuration file?

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Replay ASAP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

If you want to annoy volunteers like me this is a great way to start.

1 Like

No, I cannot store the finame or the filename pattern. Since the directories.csv is a output file generated from another Logstash component.
And thus the path is subject to change accordingly.
So any idea on how to achieve this?????

You could generate the configuration file you need (either directly from your other Logstash component) or via an extra script that detects that the file you're currently generating has changed.

Could you please explain in detail.
A short example will be really helpful!

What I'm saying is that you can create a small program (e.g. a shell script) that reads directories.csv and writes a Logstash configuration file.

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