Splunk Search

How to combine two raw events based on status?

moinyuso96
Path Finder

The raw data was uploaded from a .txt file. I managed to create the table as below.

rawTestFeatureNameStatusDateTimeStation
4015_ABCD, Start, 8/11/2020 5:37:10 PM, 123454015_ABCDStart8/11/2020 5:37:10 PM12345
4015_ABCD, Complete, 8/11/2020 5:37:30 PM, 123454015_ABCDComplete8/11/2020 5:37:30 PM12345

4015_ABCD, Start, 8/12/2020 10:23:34 AM, 12345

4015_ABCDStart8/12/2020 10:23:34 AM12345
1113_EFGH, Start, 8/12/2020 12:00:00 PM, 678901113_EFGHStart8/12/2020 12:00:00 PM67890
1113_EFGH, Complete, 8/12/2020 1:00:00 PM, 678901113_EFGHComplete8/12/2020 1:00:00 PM

67890

 

Are there any ways to combine two "raw" events based on the "status" field.

My expected result for "raw" field:

raw

4015_ABCD, Start, 8/11/2020 5:37:10 PM, 123454015_ABCD, Complete, 8/11/2020 5:37:30 PM, 12345

4015_ABCD, Start, 8/12/2020 10:23:34 AM, 12345

1113_EFGH, Start, 8/12/2020 12:00:00 PM, 678901113_EFGH, Complete, 8/12/2020 1:00:00 PM, 67890

Labels (2)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@moinyuso96 

Can you please try this?

YOUR_SEARCH
| sort - _time
| transaction TestFeatureName  startswith="Start"
| fields _raw

 

My Sample Search :

| makeresults | eval _raw="raw	TestFeatureName	Status	DateTime	Station
4015_ABCD, Start, 8/11/2020 5:37:10 PM, 12345	4015_ABCD	Start	8/11/2020 5:37:10 PM	12345
4015_ABCD, Complete, 8/11/2020 5:37:30 PM, 12345	4015_ABCD	Complete	8/11/2020 5:37:30 PM	12345
4015_ABCD, Start, 8/12/2020 10:23:34 AM, 12345	4015_ABCD	Start	8/12/2020 10:23:34 AM	12345
1113_EFGH, Start, 8/12/2020 12:00:00 PM, 67890	1113_EFGH	Start	8/12/2020 12:00:00 PM	67890
1113_EFGH, Complete, 8/12/2020 1:00:00 PM, 67890	1113_EFGH	Complete	8/12/2020 1:00:00 PM	67890" | multikv forceheader=1
| table _time raw	TestFeatureName	Status	DateTime	Station
| rename raw as _raw
| eval t = 100 | accum t | eval _time = _time + t
| sort - _time
| transaction TestFeatureName  startswith="Start"
| fields _raw


 Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

View solution in original post

kamlesh_vaghela
SplunkTrust
SplunkTrust

@moinyuso96 

Can you please try this?

YOUR_SEARCH
| sort - _time
| transaction TestFeatureName  startswith="Start"
| fields _raw

 

My Sample Search :

| makeresults | eval _raw="raw	TestFeatureName	Status	DateTime	Station
4015_ABCD, Start, 8/11/2020 5:37:10 PM, 12345	4015_ABCD	Start	8/11/2020 5:37:10 PM	12345
4015_ABCD, Complete, 8/11/2020 5:37:30 PM, 12345	4015_ABCD	Complete	8/11/2020 5:37:30 PM	12345
4015_ABCD, Start, 8/12/2020 10:23:34 AM, 12345	4015_ABCD	Start	8/12/2020 10:23:34 AM	12345
1113_EFGH, Start, 8/12/2020 12:00:00 PM, 67890	1113_EFGH	Start	8/12/2020 12:00:00 PM	67890
1113_EFGH, Complete, 8/12/2020 1:00:00 PM, 67890	1113_EFGH	Complete	8/12/2020 1:00:00 PM	67890" | multikv forceheader=1
| table _time raw	TestFeatureName	Status	DateTime	Station
| rename raw as _raw
| eval t = 100 | accum t | eval _time = _time + t
| sort - _time
| transaction TestFeatureName  startswith="Start"
| fields _raw


 Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

aasabatini
Motivator

Hi @moinyuso96 

you can try with transaction command but be careful because is too heavy

https://docs.splunk.com/Documentation/Splunk/8.2.0/SearchReference/Transaction

Regards

Ale

“The answer is out there, Neo, and it’s looking for you, and it will find you if you want it to.”

moinyuso96
Path Finder

@aasabatini What do you mean by heavy? Will it affect the performance? Because I actually have to run thousands of these text files. 

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Splunk Observability Synthetic Monitoring - Resolved Incident on Detector Alerts

We’ve discovered a bug that affected the auto-clear of Synthetic Detectors in the Splunk Synthetic Monitoring ...

Video | Tom’s Smartness Journey Continues

Remember Splunk Community member Tom Kopchak? If you caught the first episode of our Smartness interview ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud? Learn how unique features like ...