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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...