Splunk Dev

How to debug custom rest endpoint in development?

datphamtat
Explorer

Hi everyone,

I am following guide to create new custom REST endpoint, but I have problem on debug my code in local.
How I can debug python code local.
Currently, I am using Splunk Docker and mount local app to Splunk container. After every time changed code, I must refresh debug on Splunk. It is very taken time.
Does everyone have other way to debug python code on Splunk.

Thank.

Labels (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Have you seen the "Tools for Testing" docs at https://dev.splunk.com/enterprise/docs/developapps/testvalidate/#Tools-for-testing?

---
If this reply helps you, Karma would be appreciated.
0 Karma

datphamtat
Explorer

thank @richgalloway  for your suggestion, but how can I check which line error is in my code? Normally, I use to debug on python but with Splunk, It is very hard. Actually, I am using a logger to check which line of code error

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Visual Studio Code lets you step through your code line-by-line so you can see where the errors are.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...