Splunk Search

getting the field value after grouping

rsathish47
Contributor

Hi All,

Is possiable to get the field value from raw data after grouing the data by stats?

Thanks
Sathish R

Tags (2)
0 Karma

linu1988
Champion

Hello Sathish,
After you group by stats you will get the _raw data into a multi valued field. In that case you can use some mvfilter function to get the value and mv fuctions to get the count as well. Apart from that if you want to divide the fields use mvexpand then search for the value.

_http://docs.splunk.com/Documentation/Splunk/6.0.3/SearchReference/CommonEvalFunctions

Thanks

linu1988
Champion

if the DelSize can't be included in the stats in your search you can use append then make another stats to show the DelSize. After your search

|append[|search ...|| eval DelSize=if(Folder="Deleted Items",Size,"")|stats Value(DelSize) as DelSize by user]|stats Values(FolderCount) as FolderCount, Values(DelSize) as DelSize by User

But first try this
..... | eval DelSize=if(Folder="Deleted Items",Size,"") |stats count as FolderCount,Values(DelSize) as DelSize, sum(Size) as TotalSize,sum(Items) as TotalItems by User | table User FolderCount DelSize

0 Karma

rsathish47
Contributor

Thank you Linu, am doing eval and assigning value to variable/Field befor stats command, But am not able to get the value of assigned to field/variable..

Ex: ..... | eval DelSize=if(Folder="Deleted Items",Size,"") |stats count as FolderCount, sum(Size) as TotalSize,sum(Items) as TotalItems by User | table User FolderCount DelSize.
here not able to get Delsize value.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Introducing ITSI 5.0: Unified Visibility and Actionable Insights

Introducing ITSI 5.0: Unified Visibility and Actionable Insights Tuesday, July 21, 2026  |  10:00AM PT / ...

Inside Splunk Agent Observability: Understanding Agent Behavior, Tokens & Costs

Inside Splunk Agent Observability:Understanding Agent Behavior, Tokens & Costs Thursday, August 06, ...

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...