Splunk Search

How to display a search result by the Log Size per field in MB, not the event count?

pavanae
Builder

Hi

I have the following search which is presently displaying the list of eventcounts by the field "category_type", but I want to see the result in log size per field instead of event count. Is it possible to see like that? If yes please suggest me a way.

index="abc"  source="/opt/jboss/server/shoe/log/server.log" |stats count by category_type

Thanks in Advance

0 Karma
1 Solution

ppablo
Retired

Hi @pavanae

Is the answer on this previous post what you're looking for?
http://answers.splunk.com/answers/210689/how-to-get-license-usage-data-for-a-particular-ind-1.html

You'd just have to adapt the eval to convert to MB.

View solution in original post

valiquet
Contributor

index="abc" source="/opt/jboss/server/shoe/log/server.log"|foreach * [eval size_<>=len(<>)] | stats sum(size*)

0 Karma

ppablo
Retired

Hi @pavanae

Is the answer on this previous post what you're looking for?
http://answers.splunk.com/answers/210689/how-to-get-license-usage-data-for-a-particular-ind-1.html

You'd just have to adapt the eval to convert to MB.

pavanae
Builder

Thanks worked Great but what if want the result in MB. How should I modify the
...|eval MB = length(_raw) |....

0 Karma

ppablo
Retired

Just like @martin_mueller's comment in that post, but change it to convert to MB instead of GB...

 ... | eval length = length(_raw) / 1024 | ...
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...