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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...