Splunk Search

Splunk 6.5.0: How to access the first row from the search result in a dashboard?

adevi
Explorer

Recently upgraded to Splunk 6.5.0. I am trying to access the first row from the search result in a dashboard. In version 6.3.2, there was an event handler 'finalized' which provides access to the first row

Documentation from version 6.3.2 : http://docs.splunk.com/Documentation/Splunk/6.3.2/Viz/tokens#Define_search_tokens

But in 6.5.0 there is no 'finalized' handler. Only handlers available are progress, done, cancel, error, fail and none of those provide access to first row of the result

Documentation from version 6.5.0: http://docs.splunk.com/Documentation/Splunk/6.5.0/Viz/tokens#Define_search_tokens

Is there any workaround? Is it done differently in 6.5.0?

adevi
Explorer

I think its a typo in the 6.5 documentation. The done handler provides access to first row of the result. When I tried to access result.field-name in the done handler it worked . I tried eval to set the token which did not work but set token worked.

rjthibod
Champion

Please put a comment on the documentation page asking them to update the table. They will typically do it pretty quickly.

0 Karma

svenwendler
Path Finder

eval works for me using eg. tostring($result.$)

0 Karma

cmerriman
Super Champion

In your search, can you just add |head 1

0 Karma

rjthibod
Champion

I am not sure you understand. @adevi is trying to use the $result.FIELD$ feature that was in 6.3 and 6.4, but seems to be gone in 6.5. This feature allowed one to assign the result from the first row to a token for other uses in the Dashboard.

0 Karma

cmerriman
Super Champion

Yeah I know that it tokens it. But then if they only brought the one row back, they could use done or another to token.

0 Karma

rjthibod
Champion

This is quite frustrating if they took out <finalized> without giving comparable capabilities in SimpleXML. Can someone from Splunk please clarify.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...