All Apps and Add-ons

logs from the Splunk Mobile App (iOS)

bjoernjensen
Contributor

Hi,

I am using the mobile access server (1.0.1) to look at a dashboard with two panels. The first panel renders fine. The second panel uses custom javascript and is not rendered (see screenshot). The logs on the mobile access server (access_log.log and server.log) did not have any usable content.

Does the mobile app (1.0.1) have logs. And if "yes" which would be the appropriate way to have a look into them?

All the best,
Björn

screenshot from the splunk> mobile app (iphone 4s)

0 Karma

jzhong_splunk
Splunk Employee
Splunk Employee

Hi Björn,

You said the the second panel uses custom javascript. Is that a customized visualization or some HTML text or image?

Do you use to load single JavaScript or the my.js will load extra JavaScript.

Unlike the splunk web, the dashboard on mobile app is parsed and rendered locally. So if your JavaScript uses any splunkweb-specific URL, such as /static/app/myapp/mycomponent.js or ../app/myapp/mycomponent.js, it won't work on mobile. Instead you can try to get the current entry JavaScript file and load a JS file in the same folder. Sample code:

var staticFolder=getParentURL()
function getParentURL(){
  var scripts = document.getElementsByTagName('script');
  var thisScript = scripts[scripts.length-1];
  var path = thisScript.src
  var last = path.lastIndexOf('/')
  var parent = path.substr(0,last)
  return parent
}
require.config({
    paths:{
        'mychart':staticFolder+'/mychart'
    }
});
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...