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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...