All Apps and Add-ons

REST API Modular Input: HTTP Response Status Codes

bimord
Path Finder

Hi @Damien Dallimore
My question is similar to this one : https://answers.splunk.com/answers/186128 but I need a bit more guidance please (and am on Splunk 7.3.0)

I have a REST endpoint that returns json but I require the http status codes to compare the json response to.
I know that is achieved with a custom response handler and i know how to select the custom handler in the UI but I don't know how to python 😞

Please help me

0 Karma

smuderasi
Explorer

Thanks @PrewinThomas , Do you have sample custom response handler which outputs both status code and body.

0 Karma

smuderasi
Explorer

Facing same issue, Was this resolved?

0 Karma

PrewinThomas
Motivator

@smuderasi 

Splunk’s REST Modular Input allows you to ingest data from REST APIs. By default, only the response body (e.g., JSON) is indexed. To also capture the HTTP status code, you need a custom response handler—a Python class that processes the HTTP response and outputs both the status code and the body.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...