Splunk Search

Splunk Ingestion Metrics

scout29
Path Finder

I am trying to get the ingestion per day in Terabytes for each index. I am using the below search which works, however the ingestion numbers are not formatted great. For example, using the below search,  for an index i get a usage value of 4587.16 which would be 4.59 terabytes per day. I am looking for this number to be rounded in the search results to show like 4.59

index=_internal sourcetype=splunkd source=*license_usage.log type=Usage idx=*
| stats sum(b) as usage by idx | rename idx as index | eval usage=round(usage/1024/1024/1024,2)
Labels (7)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

That query works for me.  What results do you get and how do they not match what you want?

---
If this reply helps you, Karma would be appreciated.
0 Karma

scout29
Path Finder

Yes, the query works - however i want the values to be formatted differently within the search results. I would like the values to show in terabytes.  For example, using the query i get a value of 4587.43 (in GB) for an index ingestion value. I would like this to round and show in Terabytes as 4.59

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The eval command is converting bytes into gigabytes.  Add another `/1024` to convert to terabytes.

index=_internal sourcetype=splunkd source=*license_usage.log type=Usage idx=*
| stats sum(b) as usage by idx 
| rename idx as index 
| eval usage=round(usage/1024/1024/1024/1024,2)

 

---
If this reply helps you, Karma would be appreciated.
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!

How to find the worst searches in your Splunk environment and how to fix them

Everyone knows Splunk is a powerful platform for running searches and doing data analytics. Your ...

Share Your Feedback: On Admin Config Service (ACS)!

Help Us Build a Better Admin Config Service Experience (ACS)   We Want Your Feedback on Admin Config Service ...

Build the Future of Agentic AI: Join the Splunk Agentic Ops Hackathon

AI is changing how teams investigate incidents, detect threats, automate workflows, and build intelligent ...