The following block shows two events with their headers.
The first event has four fields. The second event has five fields.
When I am doing the field extraction using the Field Extractor, Script
field in event one and Script_1
field in event two are getting extracted into the same field. I am doing it on comma delimiter basis. This is happening because both Script
and Script_1
fields are have 4th place in the order of events.
I do not want both these fields to be in one field. I want them as Script="Script /test.sh ran"
and Script_1="Test Script"
.
EventID, Date_Time , Server , Script
15391 , Dec 06 15:46:22 , TestServer , Script /test.sh ran
EventID, Date_Time_1 , Server_1 , Script_1 , Status_1
15391 , Dec 06 15:47:12 , TestServer , Test Script, State : failed.
You should be able to create a calculated field with the following eval
eval script_1=if(isnotnull(status_1), script, null())
http://docs.splunk.com/Documentation/Splunk/6.5.0/Knowledge/definecalcfields
You should be able to create a calculated field with the following eval
eval script_1=if(isnotnull(status_1), script, null())
http://docs.splunk.com/Documentation/Splunk/6.5.0/Knowledge/definecalcfields
Thank you.I could not relate from your given eval.
I would like to explain the problem again.
When i make the FX for first event using the fields mentioned in the header, the second event is getting extracted as well. Now Script
field has both the values "Test Script" and "Script /test.sh ran"
I want Script="Test Script"
and Script_1="Script /test.sh ran"
.
EventID, Date_Time , Server , Script , Status
15391 , Dec 06 15:47:12 , TestServer , Test Script , State : failed.
15391 , Dec 06 15:46:22 , TestServer , Script /test.sh ran
Did this work> If not, can you share the results you're getting
Hi,
You should use different sourcetypes for each output of the scripts, in that way you will be able to address what you want.
Hope i help you
Thank you.
But both the events are coming from the same log file. Is there a way to divide them into two sourcetypes?