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!

Good Sourcetype Naming

When it comes to getting data in, one of the earliest decisions made is what to use as a sourcetype. Often, ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Splunk App for Anomaly Detection End of Life Announcement

Q: What is happening to the Splunk App for Anomaly Detection?A: Splunk is officially announcing the ...