Quantcast
Channel: Questions in topic: "splunk-enterprise"
Viewing all articles
Browse latest Browse all 47296

Bash scripted input fails on Ubuntu while OK on other distro

$
0
0
Hello, I have an issue with a scripted input. I have 2 linux on AWS : - 1 based one AWS Linux AMI - 1 based on Ubuntu On AWS Linux AMI : - script is OK when launched manually - script is OK when launched by Splunk via scripted input On ubuntu : - script is OK when launched manually - script KO when launched by Splunk via scripted input I would get errors like: Error in sitecustomize; set PYTHONVERBOSE for traceback AttributeError: module 'sys' has no attribute 'setdefaultencoding' prepare_body() takes 3 positional arguments but 4 were given I do not know why it even mention Python since it is bash script. I try each line of the script one by one but, via Splunk it fails at things such as : \#!/usr/bin/env bash set -o nounset START_TIME="${SECONDS}" ---> Fails saying SECONDS is not declared and since using 'set -o nounset'. But SECONDS is an internal variable, and since : - I do not meet that issue in other ways script is launched (on Linux AMI & manually on Ubuntu) - I get other weird errors for other small instructions anyhow Hence, sorry for not posting more clear error examples, but since script seems all OK in other contexts as mentioned, I feeI feel like I am missing something in the way script is being launched by splunk. Is there any specific I should take into account running a bash script from Splunk on Ubuntu ? Is there a way to launch such script using Splunk command like it can be done for Python using "splunk cmd python script.py" ? Thanks in advance for any hint!

Viewing all articles
Browse latest Browse all 47296

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>