Dashboards & Visualizations

Pass a token to a label

slr
Communicator

Hi everyone.

I have this issue, and is really weird. First of all, I have a 6.3 deployment.

If I put the token in a title etiquette all works fine, but when I do the same in a label etiquette like this:

<label>$token$</label>

The first time works fine, but when I reload the dashboard, Splunk adds another pair of $, and I can't see the token's value:

$$token$$

This is weird, but even more when you go to the XML code and it seems to be right:

<label>$token$</label>

but if you click in Edit Panels, and then edit input, I can see in the label text box the next:

$$token$$

If I reformat the token all work fine... until I reload the dashboard (because then all start again).

What's wrong?

I read this question/answer but didn't work for me:
https://answers.splunk.com/answers/126939/pass-token-to-a-label.html

Regards.

0 Karma

balajibt
New Member

Hi @slr, did you find a solution to this problem? I too am facing the same issue and am not able to work around this!

0 Karma

asimagu
Builder

Santi, has probado a poner el caracter $ en modo ASCII ?

quiza necesites CDATA

0 Karma

asimagu
Builder

Acabo de leer esto y puede que haya una entrada relacionada con tu problema

2015-9-22 SPL-92870 Token not visible in Visualizations Editor if the token contains "$" character.

http://docs.splunk.com/Documentation/Splunk/6.3.1/ReleaseNotes/KnownIssues#Upgrade_Issues

0 Karma

slr
Communicator

Sí, parece ser que desde Septiembre se conoce este problema... pero aún no lo han solucionado. Pues nada, toca esperar.

Gracias por la ayuda 😉

0 Karma

asimagu
Builder

por ahi la gente comenta que se puede probar a reiniciar splunk con cada cambio que pruebes, pero no le encuentro la logica...

0 Karma

slr
Communicator

Realicé algún reinicio el primer día que me encontré este problema, por probar, pero efectivamente no hay cambio en los resultados.

0 Karma

asimagu
Builder
otra idea, si lo que estas intentando hacer es poner el titulo a un panel, no es <label> sino <title>
0 Karma

slr
Communicator

Es el título de un input, y solo puede ser con label

:S

0 Karma

asimagu
Builder

humm.... quiza prueba a contruirte un panel que te diga que tokens estan disponibles en cada momento, puede ser una manera de "debugear"
En la app de ejemplos de dashboards tienes al final un par de opciones para esto. No se si ya lo habras echado un ojo.

Tiens mas info en el link link text

0 Karma

slr
Communicator

Hola Angel, gracias por la ayuda 😉

He localizado los códigos del caracter $ en esta página: http://dev.w3.org/html5/html-author/charref

Según http://docs.splunk.com/Documentation/Splunk/6.3.0/Viz/OverviewofSimplifiedXML no sería necesario usar la codificación con el símbolo $, pero lo he realizado igualmente tal cual indican en ese documento.

He usado el CDATA con las tres codificaciones posibles, y no funciona ninguna:
&#36; aparece la codificación en lugar del símbolo $
&#x00024; aparece la codificación en lugar del símbolo $
&dollar; aparece la codificación en lugar del símbolo $

Sin el CDATA esto es lo que obtengo:
&#36; ocurre exactamente lo mismo que comento en la pregunta
&#x00024; ocurre exactamente lo mismo que comento en la pregunta, añadiendo que en el XML Splunk traduce la codificación por el símbolo $
&dollar; no lo admite

¿Se te ocurre algo más?

Gracias 🙂

0 Karma

asimagu
Builder

te pasa en Firefox y en Chrome lo mismo?

0 Karma

slr
Communicator

Con ambos lo mismo, sí.

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