Getting Data In

Do we need to have universal forwarder installed in host server when we are going for scripted inputs?

raj_mpl
Path Finder

Hi All,

A straight question
1) If I want to get the database related log into splunk indexer using scripted inputs , does the Universal forwarder needs to be installed in host ?
2)If Yes , How to make the scripted input to send the log into indexer ?

Thank you !

Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi raj_mpl,
if you use a scripted inputs it's better to install a Universal Forwarder on the target server for many reasons (cache, bandwidth optimization, compression, etc...), I don't like to run a remote script.

Anyway, to do this, you have to:

  • install the Splunk Universal Forwarder on the target server,
  • create a Technical Add-on (TA),
  • put your script in $your_TA/bin,
  • edit $your_TA/local/inputs.conf and adding a stanza like the following.

    [script://./bin/your_script.sh]
    disabled = 0

    Run once per minute

    interval = 60
    sourcetype = your_sourcetype
    index = your_index

  • then restart the Universal Forwarder.

It's better to deploy this TA using a Deployment Server.

Bye.
Giuseppe

View solution in original post

darrenfuller
Contributor

Hi @raj_mpl,

Sure, Universal Forwarder is the preferred method to transfer scripted input data, but UF is not the only way to get the output of a script into Splunk.

There are plenty of reasons i can think of to not install a forwarder.. Unsupported OS; Corporate Security policies against agents; Oversubscribed boxes with limited resources; Because you don't want to.

Here is a method off the top of my head...

  1. Create script that does $things$
  2. Install script on the target server
  3. Run script from cron and output result to file
  4. Transmit log file to remote syslog server
  5. Install UF on syslog server to forward data into Splunk.

To make your life easier, have the script output one event per line, include a timestamp, and maybe use JSON or csv formatting to get the auto-field-extraction fun.

Hope this helps.

0 Karma

raj_mpl
Path Finder

Thanks @darrenfuller , Your inputs are worth to me

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi raj_mpl,
if you use a scripted inputs it's better to install a Universal Forwarder on the target server for many reasons (cache, bandwidth optimization, compression, etc...), I don't like to run a remote script.

Anyway, to do this, you have to:

  • install the Splunk Universal Forwarder on the target server,
  • create a Technical Add-on (TA),
  • put your script in $your_TA/bin,
  • edit $your_TA/local/inputs.conf and adding a stanza like the following.

    [script://./bin/your_script.sh]
    disabled = 0

    Run once per minute

    interval = 60
    sourcetype = your_sourcetype
    index = your_index

  • then restart the Universal Forwarder.

It's better to deploy this TA using a Deployment Server.

Bye.
Giuseppe

raj_mpl
Path Finder

Thanks @cusello , Its very clear that you have explained here .

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...