Logstash parser to read multiple files through input and process

Hi -

I've testng xml file contains testcaseName, status(pass/fail), error Desc, etc

And have another file jenkins.txt contains only one value jenkinBuildNumber=35

Now my requirement is to read these 2 files and add build number on every testcases. And write into mongodb.

Required Output

testcaseName| status| Error Desc| jenkinBuildNumber

Plz help how can I get this expected output.

Thanks in advance !!!

You can parse the XML with an xml filter.

If you can change the format of the other file to be a csv (jenkinBuildNumber,35) then you could retrieve that use a translate filter with a constant key.

    mutate { add_field => { "[@metadata][key]" => "jenkinBuildNumber" } }
    translate { dictionary_path => "/home/user/foo.csv" field => "[@metadata][key]" destination => "buildNumber" }
1 Like

Many Thanks Badger...Its perfectly working.

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