Splunk Search

How to calculate daily volume of logs ingested by index

jaibalaraman
Path Finder

Hi Team 

I tried the below search but not getting any result, 

index=aws component=Metrics group=per_index_thruput earliest=-1w@d latest=-0d@d
| timechart span=1d sum(kb) as Usage by series
| foreach * [eval <<FIELD>>=round('<<FIELD>>'/1024/1024, 3)]

 

jaibalaraman_0-1707334825046.png

 

 

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

You can use the licence ingest log data for that also

index=_internal source=/opt/splunk/var/log/splunk/license_usage.log idx=* type=Usage
| timechart span=1d sum(b) as bytes by idx
| foreach * [ eval <<FIELD>>=round(<<FIELD>> / 1024 / 1024, 3) ]

Round/Divide as needed to get the appropriate size unit

0 Karma

jamie00171
Communicator

hi @jaibalaraman 

try: 

index=_internal source=*metrics.log group=per_index_thruput earliest=-1w@d latest=-0d@d
| timechart span=1d sum(kb) as Usage by series
| eval Usage = round(Usage /1024/1024, 3)

0 Karma

jaibalaraman
Path Finder

yes i can see the output in the column from the below search 

source=*metrics.log group=per_index_thruput earliest=-1w@d latest=-0d@d
| timechart span=1d sum(kb) as Usage by series
| eval Usage = round(Usage /1024/1024, 3)

 

jaibalaraman_0-1707348880485.png

 

 

How do i convert the column into GB  value , also when i filter last 30 days i am able to see only last 7 days instead 30 days.  How do i fix this issue 

 

Note - When i specify the index , like for example index=aws i am not getting any search result from the search query ??

 

Thanks 

 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

After a timechart split by a field you cannot use the field name after the timechart as it no longer exists. The field names are the values of your 'series' field.

You need to use the foreach method in your initial post

The reason why index=aws returns nothing is that the data you are searching for does not exist in that index. What makes you think it did?

It is in the _internal index, so you should definitely include that

Change your earliest/latest settings to define the time period you want to search for, or use the time picker instead and remove the earliest and latest totally.

 

0 Karma

jaibalaraman
Path Finder

Yes I tried the outcome is blank 

Question - do i need to select the time frame like last 7 days or 30 days 

jaibalaraman_0-1707343157592.png

 

0 Karma

yuanliu
SplunkTrust
SplunkTrust

You have not answered fundamental questions about your dataset.  See my comment.

BTW, once you use groupby, a single aggregation function will no longer result in field name corresponding to your AS clause.  This is why operation on Usage will not do anything. (Multiple aggregation functions will result in composite field names.  Again, operation on Usage will not do anything.)

0 Karma

jaibalaraman
Path Finder

Sorry i really dont understand

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Have you taken away filters one by one, starting from the last one?  This is the first step to diagnose.  One key question you need to answer is: Is the groupby field named "series" extracted in Splunk?  A second question, of course, is whether the aggregated field "kb" extracted?

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...