Dashboards & Visualizations

Search fails when moved to Dashboard

joelm1822
Engager

I'm new to Splunk.

I've got a Search that works fine in the Search screen and correctly generates a bar chart.

index="production" source="s3://hydrow-android-logs-input-queue-prod/console/*" logWorkoutEndDebugStats releaseStage="production"
| rename workoutEndInfo.videoRestartStats.videoStopped as videoStops
| stats count by buildNumber, videoStops
| eventstats sum(count) as itemTotal by buildNumber
| eval percentage=round((count / itemTotal) * 100 , 1 )
| search videoStops = true
| chart values(percentage) over buildNumber by videoStops

 

Error when rendering as chart on a dashboard:

Screen Shot 2021-09-18 at 11.12.43 AM.png

 

When I Save it to a dashboard or create a new chart on the dashboard and enter the search as the datasource, I get the error below.  if I change the visualization from a chart to a table, then the table renders fine.  There's no indication of why the visualization works fine on the Search page, but not the dashboard.  

Any suggestions on how to debug this would be very welcome!

 

 

Labels (1)

ashvinpandey
Contributor

@joelm1822 Can you show the source code error ?

0 Karma

ro_mc
Path Finder

Do the _internal logs provide any additional information?

Does the same issue occur regardless of whether the search is inline or report-driven?

Does the browser console provide some more insight into the JavaScript error?

Potentially authorisation or app scope issues, or a need to separate into base and post process searches.

0 Karma

joelm1822
Engager

I don't know how to find the source code of the error. I'll do some digging to find the internal logs.  (I'm new to Splunk and more used to tools that show you the error rather than hiding it log files somewhere else.  Is it even possible with SplunkCloud?)

ro_mc
Path Finder

I've dug into this one a bit, and I believe it could be due to the way Splunk uses XML to handle the visualisations. Have you tried using stats instead of chart or table, and then formatting the visualisation as a chart using the GUI?

The XML for an area chart should look something like the following, for example:

<panel>
<chart><title>...</title>
<search><query>...</query>...</search>
<option name="charting.chart">area</option>
</chart>
</panel>

I.e. the chart XML is independent from the results returned by the search.

I've worked almost exclusively with on-premises instances, so I can't speak to the accessibility of the _internal index in Splunk cloud, though pressing F12 in your browser to display the console may hint at any other problems that could be occurring here.

Let me know how you go.

0 Karma
Did you miss .conf21 Virtual?

Good news! The event's keynotes and many of its breakout sessions are now available online, and still totally FREE!