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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...