Splunk Search

Group by a substring within a event results

akash_burnwal
Engager

I am actually new to splunk and trying to learn . Is there a way to group by the results based on a particular string. Although i found some of the answers here already, but its confusing for me. It will be really helpful if someone can answer based on my use case. 

Below is the sample log that i am getting:

 

[2022-01-19T13:30:15.664+00:00] [odi] [ERROR] [ODI-1134] [oracle.odi.agent] [tid: 304720] [ecid: 0000NtmXuVIC^qqMwMmZMG1XqvzZ000cRu,0:68:129:176:208:135] [oracle.odi.runtime.MrepExtId: 1501670917734] [oracle.odi.runtime.AgentName: OracleDIAgent2] [oracle.odi.runtime.ExecPhase: ExecuteTask] [oracle.odi.runtime.OdiUser: _odi] [oracle.odi.runtime.WrepName: WORKREP] [oracle.odi.runtime.ScenarioName: WEB_BOOKINGS_MV] [oracle.odi.runtime.ScenarioVer: 001] [oracle.odi.runtime.LoadPlanName: wfl_WebDataSet_MV_Refresh_2TimesAD] 

 


I want to group the results based on oracle.odi.runtime.LoadPlanName and find the latest log of it. Could someone please assist.

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You could try something like this

| rex "\[oracle\.odi\.runtime\.LoadPlanNam: (?<LoadPlanName>[^\]]*)\]"
| stats latest(_raw) as _raw by LoadPlanName

View solution in original post

0 Karma

akash_burnwal
Engager

No, the field is not extracted. what i meant by grouping is based on oracle.odi.runtime.LoadPlanName string i want to filter the results. So consider that , i have 3 results as mentioned above which had [oracle.odi.runtime.LoadPlanName : "abc"]  and for [oracle.odi.runtime.LoadPlanName : "cde"] i have another 3 results. In this case, i want to fetch only the latest log for each of them. 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You could try something like this

| rex "\[oracle\.odi\.runtime\.LoadPlanNam: (?<LoadPlanName>[^\]]*)\]"
| stats latest(_raw) as _raw by LoadPlanName
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Has this field already been extracted?

What do you mean by group?

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...