Guidance Needed: Converting Logstash Config with Nested Conditionals and Handling Multiple Input Files in Vector #21829
Replies: 1 comment
-
Hi @JeeIn-Shin, I will try to answer as much as I can with the context I have but feel free to follow up!
Remap/VRL avoids this by design. You will have to use the
The events coming out of the file source will have a
The goal here is not clear to me. Are you asking if it's possible to conditionally hook up components in a pipeline? I don't think we support that. You can have nested conditionals in Remap with VRL:
The above will work on events that are coming in from the inputs. |
Beta Was this translation helpful? Give feedback.
-
Hi Vector Community,
Our team is migrating from Logstash to Vector, and I’m currently focused on converting the output.conf from Logstash's pipeline-parser. However, I’m facing challenges with nested conditionals and handling multiple input files during the migration.
Here’s an example of the Logstash configuration we’re working with:
logstash pipeline-parser/output.conf
We’ve decided to use multiple config files and are dividing each pipeline into sources, transforms, and sinks. While we’ve successfully converted the sources and sinks, we’re currently stuck at the transforms phase, particularly due to file read/write operations and handling nested conditionals.
Specific Questions:
Nested conditionals: What’s the best way to handle deeply nested if structures in Vector’s configuration format?
File operations in transforms: In Logstash, we use filters like Ruby and Translate to read external files (e.g., /usr/share/user.csv, /usr/share/indict.csv). Vector’s remap transform doesn’t seem to support direct file reads. Is there a recommended workaround?
Additionally, we are specifying multiple files as input in sources like this:
In the transforms stage, how can we distinguish which log event originated from which file? For example:
Is there metadata (e.g., file name or path) available that identifies the source file?
How can this metadata be accessed in a remap transform to process events differently based on their input file?
I’d greatly appreciate any guidance, examples, or resources to help resolve these issues.
Thank you for your support!
Beta Was this translation helpful? Give feedback.
All reactions