Getting Data In

Where to save the r-code in splunk and how to run the r-code?

satyasai
Engager

Hi,

Where to save the R-code in splunk and how to run the r-code ?

Thanks,
sai

Tags (1)

jkat54
SplunkTrust
SplunkTrust

Splunk doesnt support Ruby scripts out of the box. You have a few options though.

  1. You can wrap your ruby code in a powershell script and setup the powershell script as a scripted input.
  2. You can wrap your ruby code in a batch script and setup the batch script as a scripted input.
  3. You can wrap your ruby code in a python script and setup the python script as a scripted input.

See inputs.conf for configuring scripted inputs.

How do you wrap a script you may ask?

In c:\run_my_ruby.bat you might do this:
c:\path\to\your\ruby.exe your_ruby_code.rb

Then in Splunk inputs.conf you could do this

[script://c:\run_my_ruby.bat]
interval = 60

Then restart splunk and profit. This would execute c:\run_my_ruby.bat every 60s from when splunk is restarted. Check inputs.conf for other interval options.

0 Karma

cmerriman
Super Champion

have you tried using this app to use R
https://splunkbase.splunk.com/app/3339/
personally, I haven't tried using R in Splunk, but I'm not sure if there is a way to save the code in Splunk itself

0 Karma

satyasai022
Engager

In this R-app in which folder i can specify/paste my r-code

0 Karma

cmerriman
Super Champion

I'm not entirely sure, since I haven't used the app myself. the documentation in splunkbase didn't work for me, but I think it's referring to this, if it helps:
https://github.com/opencpu/server-manual/blob/gh-pages/opencpu-server.pdf

0 Karma

satyasai
Engager

I need it in windows can you help me on this

0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...