Dashboards & Visualizations

Varying behavior when assigning same value to different tokens

AKG1_old1
Builder

Hi,

I am updating two different token with same value but I am seeing differernt behavior. (probably its taking as different datatype)

      <set token="graph_time_earliest">$graph_time_earliest$ - 1500</set> 
      <set token="selection.earliest_GC">$selection.earliest_GC$ - 1500</set>

Initial Value is same for both token.

graph_time_earliest = 1506990840
selection.earliest_GC = 1506990840

OutPut:

$graph_time_earliest$  =  1506990840 - 1500
$selection.earliest_GC$ =  1506989700

In $selection.earliest_GC$, its subtracting the specified value and update output. but in $graph_time_earliest$ it just append as a string. I am not sure why its taking one token as a string. Can we specify data type or its automatic?

Please suggest if I am missing something. Thank you.

0 Karma
1 Solution

niketn
Legend

@AKG1_old1, use <eval> instead of <set> to set the token since you are evaluating expression.

   <eval token="graph_time_earliest">$graph_time_earliest$ - 1500</eval> 
   <eval token="selection.earliest_GC">$selection.earliest_GC$ - 1500</eval>

Please try out and confirm. If it does not work, do give more detailed sample of your Simple XML code as to where, $graph_time_earliest$ and $selection.earliest_GC$ tokens are being set. BTW, is it $selection.earliest$ or $selection.earliest_GC$?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

niketn
Legend

@AKG1_old1, use <eval> instead of <set> to set the token since you are evaluating expression.

   <eval token="graph_time_earliest">$graph_time_earliest$ - 1500</eval> 
   <eval token="selection.earliest_GC">$selection.earliest_GC$ - 1500</eval>

Please try out and confirm. If it does not work, do give more detailed sample of your Simple XML code as to where, $graph_time_earliest$ and $selection.earliest_GC$ tokens are being set. BTW, is it $selection.earliest$ or $selection.earliest_GC$?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

AKG1_old1
Builder

silli mistake 😞 . Thank you @Niketnilay 🙂 Please convert it to answer so I can accept it.

0 Karma

niketn
Legend

@agoyal, we all have been there 🙂 Glad I was able to help out!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
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 ...