I have R (3.3.1) and opencpu (1.6.7) installed on a Linux server and we have R Project app installed on our search head as well as indexer. The Search head has connectivity to the R server via a firewall request. Below are the searches and the resultant errors.
index=sd sourcetype=sd | runRdo script="return(dataset);"
• Could not locate the time (_time) field on some results returned from the external search command 'runrdo'.
•
|inputlookup r_test.csv | runRdo script="return(dataset);"
status session message
400 0 there is no package called 'ocpu' In call: find.package(pkgname, lib.loc = lib.loc)
For your reference in Linux :
whereis R
R: /usr/bin/R /usr/lib64/R /usr/include/R /usr/share/R /usr/share/man/man1/R.1.gz
whereis opencpu
opencpu: /usr/lib/opencpu /etc/opencpu
Any suggestions ?
Hi!
Thanks for using the R app. First of all you should not install the app on indexers. The calls to the R server cannot (and should not) be made by multiple machines.
There is a few things to check / debug:
1. Is OpenCPU running? It should run as a webserver on your Linux machine. The way to test this is to get a browser and navigate to http://[address_of_your_Linux_machine]:[port]/ocpu (the port should by default be 8004). You should see the OpenCPU web interface.
2. R will not handle fields with an _ (underscore) very well. You should avoid using them, e.g. by renaming them before sending to R.
3. Give this query a try: | makeresults | eval test = "test" | table test | runRdo script="return(dataset);"
(tested and works on my machine). This will make sure it's not your input data that's causing the problem.
4. Make sure you've configured the R app properly (in your local or default folder, look for rsetup.conf and make sure it contains the url of the machine that runs OpenCPU (http://[address_of_your_Linux_machine]:[port])
I hope this helps...
Gijs
Hi Gjis,
Does this work only for R server? I tried R studio and it seems, its not working.
Thanks,
Habib
,Hi Gjis,
Can I use R studio instead of R server?
Seems like it does not work for R studio. Or am I doing something wrong?
Thanks
Habib
@habib_hussain This question is over a year old with an accepted answer so it is effectively ended. Please post a new question.
Hi!
Thanks for using the R app. First of all you should not install the app on indexers. The calls to the R server cannot (and should not) be made by multiple machines.
There is a few things to check / debug:
1. Is OpenCPU running? It should run as a webserver on your Linux machine. The way to test this is to get a browser and navigate to http://[address_of_your_Linux_machine]:[port]/ocpu (the port should by default be 8004). You should see the OpenCPU web interface.
2. R will not handle fields with an _ (underscore) very well. You should avoid using them, e.g. by renaming them before sending to R.
3. Give this query a try: | makeresults | eval test = "test" | table test | runRdo script="return(dataset);"
(tested and works on my machine). This will make sure it's not your input data that's causing the problem.
4. Make sure you've configured the R app properly (in your local or default folder, look for rsetup.conf and make sure it contains the url of the machine that runs OpenCPU (http://[address_of_your_Linux_machine]:[port])
I hope this helps...
Gijs
Thank you Gijs, #4 was the issue. I had the ocpu/library after the address for the rsetup.conf. Removed it and it works.