Splunk Search

Error during script lookup in macro

strive
Influencer

Hi,

In one of my macros, i lookup a python script. I am getting the following error.

Script for lookup table 'mypythonscript' returned error code 1. Results may be incorrect.

My macro is:

First part of macro | lookup mypythonscript clientip as ClientIP output client_city as City | Third part of macro

Our application is deployed in virtual machines. In one setup we are not facing this error, where as in other we are facing this error.

Could you please let me know what is the root cause for this error and how to resolve it.

Thanks

Strive

Tags (1)
0 Karma
1 Solution

alacercogitatus
SplunkTrust
SplunkTrust

Sounds like a problem within python installed on the system. I don't know the root cause but you can check the python by running (replace variables/paths as fits your environment):

$SPLUNK_HOME/bin/splunk cmd python /path/to/apps/myapp/bin/mypythonscript.py

If that executes correctly, then it should execute correctly during the search. If there is a typo, the script will error out and give you the specifics.

View solution in original post

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

Sounds like a problem within python installed on the system. I don't know the root cause but you can check the python by running (replace variables/paths as fits your environment):

$SPLUNK_HOME/bin/splunk cmd python /path/to/apps/myapp/bin/mypythonscript.py

If that executes correctly, then it should execute correctly during the search. If there is a typo, the script will error out and give you the specifics.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...