Hi everyone,
So I have been searching for a way to create a dashboard that would generate X number of panels based on an output.
So lets say I have an SQL query that would give me the total number of cars(10 total cars), and the dashboard would generate 10 panels based on a template.
The only thing that would change would be the search ID of the cars.
example:
<dashboard>
<row>
<panel>
<title>Car number 1</title>
<event id="myevents">
<search>
<query>index=all_my_cars_info car_id = 1 (......)</query>
<earliest>0</earliest>
</search>
</panel>
</row>
<row>
<panel>
<title>Car number 2</title>
<event id="myevents">
<search>
<query>index=all_my_cars_info car_id = 2 (......)</query>
<earliest>0</earliest>
</search>
</panel>
</row>
<row>
(THE REST OF THE 8 CARS.....)
</dashboard>
Do you know if this is possible? I know that we can integrate JS on the dashboards or create whole HTML / JS dashboard, but i don't have any knowledge with JS to know if this would do the job / how to implement.
Best Regards.
@venus699
Yes, you can achieve this using Splunk Web Framework Component. https://docs.splunk.com/DocumentationStatic/WebFramework/1.0/
You can check below links for learning how to use javascript in Splunk Dashboard with some examples.
http://dev.splunk.com/view/webframework-developapps/SP-CAAAE4A
http://dev.splunk.com/view/webframework-codeexamples/SP-CAAAEVY
http://dev.splunk.com/view/webframework-codeexamples/SP-CAAAEU7
http://dev.splunk.com/view/webframework-developapps/SP-CAAAESV
Your logic should like below.
div
tag with id
eg. <html><div id="testDiv" /> </html>
testDiv
. Note: Here you have to manage a row or new line in HTML. Which is easily manageable using HTML Tags OR CSS.During javascript development, you need to clear Splunk Enterprise's client-side Splunk Web resources using: _bump
http://<host:port>/<locale_string>/_bump
Just try and let me know if you need any help during implementation.
Thanks
@venus699
Yes, you can achieve this using Splunk Web Framework Component. https://docs.splunk.com/DocumentationStatic/WebFramework/1.0/
You can check below links for learning how to use javascript in Splunk Dashboard with some examples.
http://dev.splunk.com/view/webframework-developapps/SP-CAAAE4A
http://dev.splunk.com/view/webframework-codeexamples/SP-CAAAEVY
http://dev.splunk.com/view/webframework-codeexamples/SP-CAAAEU7
http://dev.splunk.com/view/webframework-developapps/SP-CAAAESV
Your logic should like below.
div
tag with id
eg. <html><div id="testDiv" /> </html>
testDiv
. Note: Here you have to manage a row or new line in HTML. Which is easily manageable using HTML Tags OR CSS.During javascript development, you need to clear Splunk Enterprise's client-side Splunk Web resources using: _bump
http://<host:port>/<locale_string>/_bump
Just try and let me know if you need any help during implementation.
Thanks
Hi,
Thanks for the fast response. I will have a look and try this out and let you know.
well i tyred and created some examples, but my knowledge of JS is not enought to do this, i sopted when trying to creat a token from result of a search, so with that value i could create the numver of panels i needed.
Guess i will have to find other way, thanks anyway.