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 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...