<?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 Re: Search different results with token in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529829#M35962</link>
    <description>&lt;P&gt;Run anywhere example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=splunkd | eval field1=if(group="tcpin_connections",1,0) | eval field2=if(group="tcpout_connections",1,0) | stats sum(field1) as tcpin_connections sum(field2) as tcpout_connections by log_level&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisY.abbreviation"&amp;gt;auto&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.stackMode"&amp;gt;default&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;top&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;drilldown&amp;gt;
          &amp;lt;set token="showcounts"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;set token="showloglevel"&amp;gt;$click.value$&amp;lt;/set&amp;gt;
          &amp;lt;set token="showgroup"&amp;gt;$click.name2$&amp;lt;/set&amp;gt;
        &amp;lt;/drilldown&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel depends="$showcounts$"&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=splunkd log_level=$showloglevel$ group=$showgroup$ | stats count by component&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisY.abbreviation"&amp;gt;auto&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.stackMode"&amp;gt;default&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;top&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;For your case, you could change the first query to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;          &amp;lt;query&amp;gt;index=.... hostname=* 
| eval field1=if(x="y",1,0)
| eval field2=if(x="z",1,0)
| stats sum(field1) as y sum(field2) as z by hostname&amp;lt;/query&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;with perhaps tokens showhost and showx&lt;/P&gt;&lt;P&gt;&amp;nbsp;and the second query to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;          &amp;lt;query&amp;gt;index=.... hostname=$showhost$ x=$showx$ ...&amp;lt;/query&amp;gt;&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 17 Nov 2020 21:27:43 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2020-11-17T21:27:43Z</dc:date>
    <item>
      <title>Search different results with token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529788#M35958</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a query like this:&lt;/P&gt;&lt;P&gt;index=.... hostname=*&amp;nbsp;&lt;BR /&gt;| eval field1=if(x="y",1,0)&lt;BR /&gt;| eval field2=if(x="z",1,0)&lt;BR /&gt;| stats sum(field1) as "field1" sum(field2) as "field2" by hostname&lt;/P&gt;&lt;P&gt;The result is a column chart in which I have 2 columns for each hostname that represent the count of filed1 and field2. If I click on a bar (for example filed1 for an hostname), I want to open another custom dashboard that shows other details like ip,.... But in this second dashboard I don't have only the results for field1, but also filed2. I know I need a token to filter the result, but I don't know how. Can anyone help me?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 16:42:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529788#M35958</guid>
      <dc:creator>marco_massari11</dc:creator>
      <dc:date>2020-11-17T16:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Search different results with token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529809#M35960</link>
      <description>&lt;P&gt;Instead of field1 and field2, can you name your fields y and z, that way you may be able to use the field name of the bar that is clicked to modify the search in the drilldown panel. Alternatively, will counting by x and hostname help?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 19:04:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529809#M35960</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-11-17T19:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Search different results with token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529812#M35961</link>
      <description>&lt;P&gt;I do not understand your first option, can you explain it better? The second option can work but I don't want to show the hostname two times in the column chart.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 19:31:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529812#M35961</guid>
      <dc:creator>marco_massari11</dc:creator>
      <dc:date>2020-11-17T19:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Search different results with token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529829#M35962</link>
      <description>&lt;P&gt;Run anywhere example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=splunkd | eval field1=if(group="tcpin_connections",1,0) | eval field2=if(group="tcpout_connections",1,0) | stats sum(field1) as tcpin_connections sum(field2) as tcpout_connections by log_level&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisY.abbreviation"&amp;gt;auto&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.stackMode"&amp;gt;default&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;top&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;drilldown&amp;gt;
          &amp;lt;set token="showcounts"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;set token="showloglevel"&amp;gt;$click.value$&amp;lt;/set&amp;gt;
          &amp;lt;set token="showgroup"&amp;gt;$click.name2$&amp;lt;/set&amp;gt;
        &amp;lt;/drilldown&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel depends="$showcounts$"&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=splunkd log_level=$showloglevel$ group=$showgroup$ | stats count by component&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisY.abbreviation"&amp;gt;auto&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.stackMode"&amp;gt;default&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;top&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;For your case, you could change the first query to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;          &amp;lt;query&amp;gt;index=.... hostname=* 
| eval field1=if(x="y",1,0)
| eval field2=if(x="z",1,0)
| stats sum(field1) as y sum(field2) as z by hostname&amp;lt;/query&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;with perhaps tokens showhost and showx&lt;/P&gt;&lt;P&gt;&amp;nbsp;and the second query to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;          &amp;lt;query&amp;gt;index=.... hostname=$showhost$ x=$showx$ ...&amp;lt;/query&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 Nov 2020 21:27:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529829#M35962</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-11-17T21:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Search different results with token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529888#M35970</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think it's not working beacause I still have more result in the second query&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 11:19:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529888#M35970</guid>
      <dc:creator>marco_massari11</dc:creator>
      <dc:date>2020-11-18T11:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Search different results with token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529889#M35971</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228757"&gt;@marco_massari11&lt;/a&gt;&amp;nbsp;, I'm not sure if I got the question completely correct.&lt;BR /&gt;But in case, you require only the results of the bar you clicked on, then you can retrieve the name of the field using :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;set token="clicked_field"&amp;gt;$click.name2$&amp;lt;/set&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and use the token $clicked_field$ to filter results in the query of the other dashboard.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 11:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529889#M35971</guid>
      <dc:creator>t_shreya</dc:creator>
      <dc:date>2020-11-18T11:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Search different results with token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529893#M35972</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225841"&gt;@t_shreya&lt;/a&gt;&amp;nbsp; Yes, I set by drilldown tab on the first dashboard a token named "method"=$click.name2$, and the query of the first dashboard is like this:&lt;/P&gt;&lt;P&gt;index=.. hostname=$site$ (service=success or service=failure)&lt;BR /&gt;| eval site=substr(NetworkDeviceName,1,7) + substr(NetworkDeviceName, -4)&lt;BR /&gt;| eval field1=if(service="x",1,0)&lt;BR /&gt;| eval field2=if(service="y",1,0)&lt;BR /&gt;| stats sum(field1) as "option1" sum(field2) as "option2" by site&lt;/P&gt;&lt;P&gt;The result is a column chart in which I have 2 columns (count of field 1 and count for field2) for a single site&lt;/P&gt;&lt;P&gt;In the second dashboard I have a query like this:&lt;/P&gt;&lt;P&gt;index=..... hostname=....&lt;BR /&gt;| eval site=substr(DeviceName,1,7) + substr(DeviceName, -4)&lt;BR /&gt;| search site=$group$&lt;BR /&gt;| search service="$method$"&lt;BR /&gt;| table .......&lt;/P&gt;&lt;P&gt;Probably my mistake is in the stats beacuse in the title I put the token for the count ant it's correct&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 11:54:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529893#M35972</guid>
      <dc:creator>marco_massari11</dc:creator>
      <dc:date>2020-11-18T11:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Search different results with token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529991#M35979</link>
      <description>&lt;P&gt;I don't know what you mean by that. Can you show your SimpleXML for your dashboard panels?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 18:48:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Search-different-results-with-token/m-p/529991#M35979</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-11-18T18:48:57Z</dc:date>
    </item>
  </channel>
</rss>

