Getting Data In

How to deploy scripted inputs on different OS architectures?

sjaworski
Communicator

I have two scripted inputs, one bash script for Linux and one batch script for Windows. Both scripts are written to read a static configuration file and output the data for Splunk to ingest. Both scripts work without issue.

Should I deploy both script inputs in the same app? As you know the bash script will not run on Windows and batch script will not run on LInux. Besides the error I get in the splunkd.log, is there anything I should worry about with the scripts executing on the wrong OS architecture?

0 Karma

woodcock
Esteemed Legend

I hate errors and would create an app for each OS. You should already have the host discrimination part of serverclass.conf done for the various TAs that you need to deploy differently depending on OS. But there is nothing that will be broken if you deploy both to both.

0 Karma

somesoni2
Revered Legend

Beside the error, I don't think there is any other issue doing that. It's basically that error message vs maintenance overhead of 2 apps. Have you considered developing the script using some common language like python or perl?

0 Karma

sjaworski
Communicator

There's no guarantee there will be a perl or python interpreter on the destination systems.

0 Karma

somesoni2
Revered Legend

That's correct. If you were using Splunk Enterprise instance(not universal forwarder) and your script was simple enough to be developed using standard python library that ships with Splunk, then it would've worked. So many if's so I think you're fine. (its easiness vs best practices).

0 Karma

sjaworski
Communicator

Thanks for the thoughts. Always good to double check.

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 ...