Splunk Dev

How to use Splunk Query as Datasource for React Splunk App

teddy2fast
New Member

Hey All,

I was creating an app that runs inside Splunk. I was following this tutorial , https://splunkui.splunk.com/Create/AppTutorial .

When I try to make use of just a dashboard definition, I think it has an issue with authentication or something like that. I could not figure out how to make use of the dashboard studio dashboard definitions to create visuals. All of the examples, show hard coded datasources. I’m stumped on how to create views that depend on Splunk query results in ReactJS.  Also, I am using Splunk Enterprise with a Developer license.


To make things short:  How do i use a Splunk Query as a datasource for a Reactjs Splunk App for Splunk Enterprise? 


Ted

Labels (2)
0 Karma

nhaq
Splunk Employee
Splunk Employee

Hey Ted, 

Thanks for pointing that out. We hope to soon have more examples where we can showcase how to use Splunk data in custom applications with Splunk UI and Splunk Dashboards. I have two other examples I want to share, the first one is a dashboard example that uses static data however the static data is within the dashboard definition. You can find that example in this github

The other example is one made by one of our field users. This example actually has some interaction with using json data that we attach and have the user upload. I think this can also help with what you are looking for. You can find that here

Lastly, if you have any other "types" of examples you would like to see, I would like to hear your feedback, we hope to expand our library to include more useful examples for developers with unique and relatable use cases. 

 

0 Karma

teddy2fast
New Member

Hey @nhaq ,

I figured out how to do it without it crashing out on me. The tutorials that you sent worked some, but I think parts were broken or didn't fully cover my use case.  I did some searching through the repo and found the dashboardTutorial2. That one worked perfectly. https://github.com/splunk/dashboardTutorial2 

I was able to follow the tutorial successfully. Then, I created my own dashboard and dashboard definition, then tested it out and it worked. 

Notes:
1. For the step where you have to "Test Run". It didn't work in the order of the commands. I had to run

yarn install

  before I ran 

npm install @splunk/dashboard-core @splunk/dashboard-presets @splunk/dashboard-context

Then, it worked. 

Thanks!

0 Karma

nhaq
Splunk Employee
Splunk Employee

Hello Ted, 

Glad to hear that tutorial 2 worked out well but I am sorry about the errors and things we may have missed. If you don't mind, could you email me at nhaq@splunk.com regarding the errors you experienced so that we can work on improving them? It would be a huge help. Thank you!

 

 

0 Karma
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 ...