All Apps and Add-ons

The examples for RProject App are not working

radhikabhagavat
New Member

The examples for RProject App are not working. In fact I see issues with any command using input from the Splunk and passed on to R like:

index=test field1=somevalue| r "output<-summary(input)"

As mentioned above, Splunk->R flow is not working.

However I am able to read an external csv through this app in r command and display the output in Splunk. So R-> Splunk flow is working

Please help as I need to apply R functions on indexed data in Splunk as per my project requirements. Thanks.

Tags (1)
0 Karma

krwinters11
Path Finder

I don't know if this will solve all of your problems, but there should be an = instead of <- in between output and summary.

0 Karma

krwinters11
Path Finder

you will also probably need to call the source file. The format I use works and looks like this:
... | r "
source('sourceFile.r') 
output = data.frame(functionName(input))
"

And apparently separate lines are very important. If will fail it if it is all on one line...not sure why (@rfujara_splunk)

0 Karma

radhikabhagavat
New Member

Thanks for responding back.

The example queries are already using = and not <- and no script file yet.

0 Karma

rfujara_splunk
Splunk Employee
Splunk Employee

Is there any error message? Why exactly happens?

0 Karma

radhikabhagavat
New Member

Sorry for delay in replying :

I see the following error:

index=_internal | head 1000 | table source | r "output=summary(input)"

command="r", R exited with code 1: Error: unexpected input in: "library = new_library input <- read.csv( "c:\windows\temp\tmpwa3cgd" , C:\" Execution halted

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...