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!

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