<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to reference transposed column::row value in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309937#M19783</link>
    <description>&lt;P&gt;I have a panel in a dashboard that parses xml, and displays them with transpose.  This is a head 1, so there will only ever be one row.  I want to set a token based on the row 1 value of column=ActivityId for use in another panel.&lt;/P&gt;

&lt;P&gt;I suppose I can create a redundant hidden search associated using that query without the transpose to assign that token, but I would like to just see if I can set it all within that panel xml in the dashboard.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search
| head 1 
| rex field=_raw "(?is)request=(?&amp;lt;xmlData&amp;gt;.+)$" 
| fields xmlData 
| xmlkv xmlData 
| fields - _* xml* 
| transpose 
| rename column as KEY, "row 1" as VALUE 
| sort KEY
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives me the clean table of key value pairs, and I want to use the VALUE of KEY=ActivityId.  Then use it like this in my dashboard&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;         &amp;lt;done&amp;gt;
            &amp;lt;set token="activity_id"&amp;gt;$result.ActivityId$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 04 Apr 2017 16:31:25 GMT</pubDate>
    <dc:creator>Cuyose</dc:creator>
    <dc:date>2017-04-04T16:31:25Z</dc:date>
    <item>
      <title>How to reference transposed column::row value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309937#M19783</link>
      <description>&lt;P&gt;I have a panel in a dashboard that parses xml, and displays them with transpose.  This is a head 1, so there will only ever be one row.  I want to set a token based on the row 1 value of column=ActivityId for use in another panel.&lt;/P&gt;

&lt;P&gt;I suppose I can create a redundant hidden search associated using that query without the transpose to assign that token, but I would like to just see if I can set it all within that panel xml in the dashboard.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search
| head 1 
| rex field=_raw "(?is)request=(?&amp;lt;xmlData&amp;gt;.+)$" 
| fields xmlData 
| xmlkv xmlData 
| fields - _* xml* 
| transpose 
| rename column as KEY, "row 1" as VALUE 
| sort KEY
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives me the clean table of key value pairs, and I want to use the VALUE of KEY=ActivityId.  Then use it like this in my dashboard&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;         &amp;lt;done&amp;gt;
            &amp;lt;set token="activity_id"&amp;gt;$result.ActivityId$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Apr 2017 16:31:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309937#M19783</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2017-04-04T16:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference transposed column::row value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309938#M19784</link>
      <description>&lt;P&gt;Yes, you can do that, and you're pretty close to the right XML.   Look at the example in the accepted answer here, which uses &lt;CODE&gt;finalized&lt;/CODE&gt; rather than done, for the same effect.  &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/442254/how-to-set-a-token-from-a-base-search-in-my-dashbo.html"&gt;https://answers.splunk.com/answers/442254/how-to-set-a-token-from-a-base-search-in-my-dashbo.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 17:31:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309938#M19784</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-04-04T17:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference transposed column::row value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309939#M19785</link>
      <description>&lt;P&gt;I can get the xml to work, the issue I am having is that I cant reference the transposed values.  so activity_id is set to the literal string $result.ActivityId$  because a field ActivityId doesn't exist after the transpose&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 17:47:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309939#M19785</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2017-04-04T17:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference transposed column::row value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309940#M19786</link>
      <description>&lt;P&gt;Try to change the your panel search like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search
 | head 1 
 | rex field=_raw "(?is)request=(?&amp;lt;xmlData&amp;gt;.+)$" 
 | fields xmlData 
 | xmlkv xmlData 
 | fields - _* xml* 
 | transpose 
 | rename column as KEY, "row 1" as VALUE 
 | eval KEY=if(KEY="ActivityId","1.ActivityId",KEY)
 | sort KEY
 | eval KEY=if(KEY="1.ActivityId","ActivityId",KEY)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And use this to set the token&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;set token="activity_id"&amp;gt;$result.VALUE$&amp;lt;/set&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically make the row with ActivityID as the first row so that $result.VLAUE$ will contain value corresponding to ActivityID.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 18:31:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309940#M19786</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-04T18:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference transposed column::row value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309941#M19787</link>
      <description>&lt;P&gt;Ahh, clever.  I see now.  Basically you are making sure that the key you want the value for is first in the list, then reset its displayed KEY.&lt;/P&gt;

&lt;P&gt;This solved the issue in an unexpected way.  If I wanted to set 2 tokens instead of just one, would this be possible?  Like setting what you want with a 1.KEY, 2.KEY, etc.  The problem I see then is assigning it to a token.  since that is $result.VALUE$  it would be cool to do $result.1.VALUE$ $result.2.VALUE$ etc&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 19:28:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309941#M19787</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2017-04-04T19:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference transposed column::row value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309942#M19788</link>
      <description>&lt;P&gt;Another trick is that you can copy this to an otherwise invisible field beginning with an underscore (such as &lt;CODE&gt;_key&lt;/CODE&gt;) which means that the data will not be visible inside of your visualization but will be accessible by reference.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 20:27:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-transposed-column-row-value/m-p/309942#M19788</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-04-04T20:27:21Z</dc:date>
    </item>
  </channel>
</rss>

