All Apps and Add-ons

REST API usage to get log size at source level? Splunk UI query works well.

srujanredy
New Member

Equivalent Splunk UI query: Working well
source=/abc/log/* earliest="11/19/2018:08:00:00" latest="11/19/2018:18:00:00" | eval raw_len=len(_raw) | eval raw_len_gb = raw_len/1024/1024/1024 | stats sum(raw_len_gb) as GB by source, host | sort - GB

Rest API Usage?

I've tried the below curl command via REST API but didn't get same log sizes as in splunk UI query.

curl -vu user:pass -d output_mode=csv -o /home/someuser/output.csv -k https://organisation.fmr.com/servicesNS/admin/search/search/jobs/export -d search='search earliest="11/19/2018:08:00:00" latest="11/19/2018:18:00:00" group=per_source_thruput series=/abc/log/* | eval raw_len=len(_raw) | eval raw_len_gb = raw_len/1024/1024/1024 | stats sum(raw_len_gb) as GB by series | sort - GB'

Results from Splunk UI are 100-1000% greater than results from the Curl via REST API.

Can someone please help me with the correct REST API usage to get the same results as given by splunk UI query.

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...