Get the im_file path
How can I get the filepath from im_file and pass it as variable in the Output.. as you can see i am using Recursive TRUE, want's to know which file from which directory, current message came from
<Input tst> Module im_file File "/home/*.log" Recursive TRUE </Input>
<Output tst_testfile> Module om_file File "/home/user/nxlogtest" <Exec> $tst_filepath = ??; $Message = $raw_event; to_json(); </Exec> </Output>
<Route tst_out> Path maas => maas_testfile </Route>
Add something like
Exec $WhichFile=file_name();
to your individual im_file Input. No need to add anything to the Output - it will appear as WhichFile in e.g. Graylog in 'Fields'.