Knowledge Management

How to find out size of sistats based summaries

knielsen
Contributor

Hello,

We're having about 200 daily summaries, and about a third of them are sistats based.

For resizing efforts, I wanted to get an overview of how much data each summary consumes on a daily base.

Naively, I thought this would give me the result:

index=summary_1d | stats sum(eval(len(_raw))) as SizeMB by source | eval SizeMB=round(SizeMB/1024/1024,2) | sort - SizeMB | addcoltotals

This only works for the summaries that were not created with the si- commands though. Due to the nature of sistats, even this will give no answer for a single source:

index=summary_1d source="sistats 1d foobar" | eval bytes=len(_raw)  | stats sum(bytes)

While this would work:

index=summary_1d source="sistats 1d foobar" | eval bytes=len(_raw)  | table bytes | stats sum(bytes)

I don't want to do this manually per source and then bring the results together though. Can anyone think of a more convenient way to get the result for all sources in one go?

Thanks,
-Kai.

0 Karma
1 Solution

knielsen
Contributor

I figured it out myself. I can use the "table trick" for everything, put the source in the table as well, and do stats on that. Surely not the most efficient way, but it works to get the overview I wanted.

index=summary_1d | table source _raw | eval bytes=len(_raw) | stats sum(bytes) as SizeMB by source | eval SizeMB=round(SizeMB/1024/1024,2) | sort - SizeMB | addcoltotals

If there is a better solution, feel free to add that as well... 🙂

View solution in original post

0 Karma

knielsen
Contributor

I figured it out myself. I can use the "table trick" for everything, put the source in the table as well, and do stats on that. Surely not the most efficient way, but it works to get the overview I wanted.

index=summary_1d | table source _raw | eval bytes=len(_raw) | stats sum(bytes) as SizeMB by source | eval SizeMB=round(SizeMB/1024/1024,2) | sort - SizeMB | addcoltotals

If there is a better solution, feel free to add that as well... 🙂

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...