Getting Data In

How do I capture the output of a script from a scripted input?



I have a script which I'd like to capture the output from. I assumed that as long as I had it started by my splunkforwarder with an interval=0 it would run for ever and capture anything the script generates. But doesn't appear so.

  interval = 0
  index = main
  sourcetype = spidertrap
  source =
  disabled = 0

The script source can be found here -

I've verified that Splunk is running the script. If I run the script directly I get output to the console I expect.

Any ideas?

Tags (3)
0 Karma

Revered Legend

Try to use print function to print your data to stdout which Splunk reads. See this for reference.

0 Karma


Interestingly enough not picking up anything from a print either.

0 Karma


Not seeing print in your github source. Borrowing from SO:

with open('out.txt', 'w') as f:
    print >> f, 'Filename:', filename     # Python 2.x
    print('Filename:', filename, file=f)  # Python 3.x

If this reply helps you, an upvote would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Don't wait! Accept the Mission Possible: Splunk Adoption Challenge Now and Win ...

Attention everyone! We have exciting news to share! We are recruiting new members for the Mission Possible: ...

Unify Your SecOps with Splunk Mission Control

In today’s post, I'm excited to share some recent Splunk Mission Control innovations. With Splunk Mission ...

Data Preparation Made Easy: SPL2 for Edge Processor

By now, you may have heard the exciting news that Edge Processor, the easy-to-use Splunk data preparation tool ...