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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...