Getting Data In

feeding fields to an external script

mjones414
Contributor

I've written a little python one-liner that basically calls showmount -a with an argv array at the end and my goal is to be able to feed it a list of hosts and get the showmount output for each host.

if I do:
| showmount

this works

if I do

host=pattern* | showmount host

nothing happens.

this is the extent of my oneliner:

subprocess.call(['showmount', '-a', sys.argv[1]])

What can I do to make this actually show me a list per host with each host being an event?

Tags (3)
0 Karma

pryzrak
Path Finder

Make sure you have the command listed in transforms.conf with the input of 'host'

If you do, then it will only take the field named 'host' unless you use the following example:

<search> | showmount host as <your_input_field>
0 Karma
Get Updates on the Splunk Community!

Enhance Your Splunk App Development: New Tools & Support

UCC FrameworkAdd-on Builder has been around for quite some time. It helps build Splunk apps faster, but it ...

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...