Getting Data In

How to log REST API calls?

abhisawa
Explorer

Hi,

I am trying to debug Splunk REST API calls and need verbose logging of life cycle of that transaction on server side.

In this documentation: http://docs.splunk.com/Documentation/Splunk/6.2.1/RESTUM/RESTusing#Logging_REST_calls
it mentioned
'To log REST API calls to the splunkd.log file, set the special logger REST_Calls to -X DELETE0.'

Where and how to set REST_Calls ?

I tried following which definitely doesn't work

/opt/splunk/bin/splunk set log-level REST_Calls -level 'DELETE0'

I tired setting it up to DEBUG but that didn't give me much information related to my query.

/opt/splunk/bin/splunk set log-level REST_Calls -level 'DEBUG'

Any other way to turn on debugging ?

Tags (2)

wrangler2x
Motivator

You can do it through the CLI. I have this in my .bashrc on the splunk account so I can use the 'splunk' command anywhere:

    alias splunk=/opt/splunk/bin/splunk

Turn debug on:

    `$ splunk set log-level REST_Calls -level DEBUG`

Set it back:

    `$ splunk set log-level REST_Calls -level INFO`

See what it is set to:

    `$ splunk show log-level REST_Calls`

These are also available through the GUI:

    System settings » System logging » REST_Calls

martin_mueller
SplunkTrust
SplunkTrust

Setting the level for REST_Calls in http://localhost:8000/en-US/manager/search/server/logger?offset=450 tops out at DEBUG for me. Setting that significantly increases (zero to 100, basically) the logging for that component in splunkd.log.

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 ...