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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...