All Apps and Add-ons

How to use igraph package in the R App for Splunk?

xiangtaner
Path Finder

Hi,

I am currently exploring the R App for Splunk. For a specific analysis purpose, I need to use ‘igraph’ library. I tried several times and didn’t work the code out. When I tried to add ‘igraph’ package in ‘Manage Packages’, the “state” is always “Installing” as you can see from the attached pic.

Could you please advise me whether this is because that this App currently does not support the ‘igraph’ package or maybe I didn’t configure the App correctly?
alt text
Thanks and Best Regards,

Ningwei

Tags (1)
0 Karma

rfujara_splunk
Splunk Employee
Splunk Employee

Hi xiangtaner, I just tried to install the igraph package on my installation.

It worked without any problems:

  1. entered the name "igraph" as a package name and hit "Add Package" button
  2. the package should appeared in the list of packages (state="Not Installed")
  3. hit the "Install Now" button
  4. state changed to "Installing" and spinning wheel appeared
  5. state changed to "Installing Dependencies" and spinning wheel still visible
  6. state changed to "Installed" and spinning wheel disappeared

I never refreshed browser page manually!

On your screenshot, I cannot see the spinning wheel. This indicated that you have manually reloaded the browser page.

Please try the following:

  1. hit the "Delete" button for the igraph on the package list
  2. Open the "Examples" page (this triggers the R engine and makes sure everything that is already installed related to the igraph package is cleaned up)
  3. Make sure the examples are not leading into error messages and results are shown
  4. Go pack to the "Packages" page
  5. Try installation of igraph package again (but without reloading the page)
  6. If installation failes, a error message should pop up

Thanks,
Robert

0 Karma

xiangtaner
Path Finder

Hi Robert,

Thanks for the update! But the error message is still the same “A unexpected error occurred”.

Thanks and Regards,

Wayne

0 Karma

xiangtaner
Path Finder

Thanks Robert,

With the new release, I was able to save the R library installation path. Thanks for the quick fix!

However, when I install the igraph package, it still failed. The error message is the same as before "A unexpected error occurred". The installation stopped and the state stays on "Installing" without spinning wheel.

Are there any other configuration I should do? Based on some others experiences I found on the Internet, I even modified the r.conf file under folder "C:\Program Files\Splunk\etc\apps\r\default" by specifying the "path" value for r, but this still failed.

Please further advise me.

Thanks,

Wayne

0 Karma

rfujara_splunk
Splunk Employee
Splunk Employee

I just created a new version which I'll send to you via email. I added some extra error handling to show a more detailed error message. After installing this new version, may you please again delete the igraph package, run the examples page and go back to the packages page to add the igraph package again? Which error message appears?

0 Karma

xiangtaner
Path Finder

Hi Robert,

Thanks for the detailed instructions!

Yes, I did see the "Installing" and spinning wheel, but in around 2 minutes it stopped and popped up an error message saying "an unexpected error occurred". Then the state stays on "installing" but the spinning wheel disappeared.

What's the purpose of this "Add Package" process in Splunk? Is it identical to the installation of packages directly from R? Or it's a MUST HAVE process in order to run R code specifically in Splunk? I have already installed igrpah package in R, will this be the conflict?

Also, the R App in Splunk may not be set or configured correctly, as I encountered error message when I specify the library installation path in "Setup the R App" page as "C:\Program Files\R\R-3.2.1\bin\R.exe" and try to save it. Please see the message below. However I can run the sample code "| r "output=data.frame(Name=c('A','B','C'),Value=c(1,2,3))"' successfully.


This XML file does not appear to have any style information associated with it. The document tree is shown below.

INTERNAL SERVER ERROR


Could you please help further identify the problems and advise me how I can address it?

Thanks and Best Regards,

Wayne

0 Karma

rfujara_splunk
Splunk Employee
Splunk Employee

When you use R, you're always using it within a R environment. There is the default environment which is used when just invoking R. But the Splunk R Project does uses it's own environment. So whatever you've already installed within the default environment is not used when using R within Splunk. That's why you need to (re)install the igraph package again.

I just uploaded a new version of the app.

After knowing about the error message, I think the original problem is, that setting up / configuring the app didn't work because of a bug in the setup page.

This bug is fixed now, so could you please try to open the setup page again and just hit Save?

After that, open the Packages page, remove the igraph package, and then reinstall it.

Robert

aljohnson_splun
Splunk Employee
Splunk Employee

Were you able to install any other packages? Or was this the only one that didn't work?

0 Karma

xiangtaner
Path Finder

thanks for the quick response! I tried another package 'plyr' and it has the same state "installing". So my question is if it works, should the State be "installed" instead of "installing"?

Thanks!

0 Karma
Get Updates on the Splunk Community!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...