<?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: How to Use Replace Command in Drilldown with Unique Values? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495275#M32422</link>
    <description>&lt;P&gt;Hi rkrish71&lt;/P&gt;

&lt;P&gt;Try using replace command in drilldown like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;drilldown&amp;gt;
          &amp;lt;eval token="name"&amp;gt;replace($click.value2$, "Sarath","Sarath kumar")&amp;lt;/eval&amp;gt;
        &amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Guess this could help you solve your issue.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Mar 2020 07:46:23 GMT</pubDate>
    <dc:creator>skrajkumar_splu</dc:creator>
    <dc:date>2020-03-13T07:46:23Z</dc:date>
    <item>
      <title>How to Use Replace Command in Drilldown with Unique Values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495274#M32421</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I really appreciate the value splunk forum and the help from the community. Learning a lot. &lt;BR /&gt;
I have a question as I am trying to figure this out.&lt;/P&gt;

&lt;P&gt;I have data coming from different APIs and it has parameter on the header. I have used replace command in the header and stored each values under a variable like example below.&lt;/P&gt;

&lt;P&gt;example using replace:&lt;BR /&gt;
api/v1/testuser1  -&amp;gt; api/v1/unique_value&lt;BR /&gt;
api/v2/testinfo1  -&amp;gt; api/v2/unique_value&lt;/P&gt;

&lt;P&gt;Replace Query:&lt;BR /&gt;
| eval api=replace(api, "(api/v1/.&lt;EM&gt;)","api/v1/unique_value")&lt;BR /&gt;
| eval api=replace(api, "(api/v2/.&lt;/EM&gt;)","api/v2/unique_value")&lt;/P&gt;

&lt;P&gt;when I run this as a search query, I am able to fetch the results. But when I use the above in a dashboard drilldown. it doesn't work.&lt;BR /&gt;
Can someone please help with this? Thanks. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:37:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495274#M32421</guid>
      <dc:creator>rkrish71</dc:creator>
      <dc:date>2020-09-30T04:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Replace Command in Drilldown with Unique Values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495275#M32422</link>
      <description>&lt;P&gt;Hi rkrish71&lt;/P&gt;

&lt;P&gt;Try using replace command in drilldown like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;drilldown&amp;gt;
          &amp;lt;eval token="name"&amp;gt;replace($click.value2$, "Sarath","Sarath kumar")&amp;lt;/eval&amp;gt;
        &amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Guess this could help you solve your issue.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 07:46:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495275#M32422</guid>
      <dc:creator>skrajkumar_splu</dc:creator>
      <dc:date>2020-03-13T07:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Replace Command in Drilldown with Unique Values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495276#M32423</link>
      <description>&lt;P&gt;Hi, Thanks for helping out.&lt;/P&gt;

&lt;P&gt;Does that go as a token or in the replace command query itself like below?  &lt;/P&gt;

&lt;P&gt;Eg:&lt;BR /&gt;
replace($click.value2$, "(api/v2/.)", "api/v2/unique_value")&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 16:57:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495276#M32423</guid>
      <dc:creator>rkrish71</dc:creator>
      <dc:date>2020-03-13T16:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Replace Command in Drilldown with Unique Values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495277#M32424</link>
      <description>&lt;P&gt;hi @rkrish71,&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Label&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Panel 1&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;
              | makeresults 
              | eval _raw=" api
              /api/v1/testuser1
              /api/v2/testinfo1" 
              | multikv forceheader=1 
              | eval api=replace(api, "/[\w]+$", "/unique_value")
          &amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
        &amp;lt;drilldown&amp;gt;
          &amp;lt;set token="api"&amp;gt;$row.api$&amp;lt;/set&amp;gt;
        &amp;lt;/drilldown&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;html&amp;gt;
      &amp;lt;h1&amp;gt;Token value: $api$&amp;lt;/h1&amp;gt;
    &amp;lt;/html&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Mar 2020 17:09:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495277#M32424</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-13T17:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Replace Command in Drilldown with Unique Values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495278#M32425</link>
      <description>&lt;P&gt;It should go as a drilldown token like the below snippet&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Sarath&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults | eval name= "My Name is Sarath" | table name&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;drilldown&amp;gt;
          &amp;lt;eval token="name"&amp;gt;replace($click.value2$, "Sarath","Sarath kumar")&amp;lt;/eval&amp;gt;
        &amp;lt;/drilldown&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|makeresults| eval name="$name$" | table name&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&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="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Mar 2020 17:10:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495278#M32425</guid>
      <dc:creator>skrajkumar_splu</dc:creator>
      <dc:date>2020-03-13T17:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Replace Command in Drilldown with Unique Values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495279#M32426</link>
      <description>&lt;P&gt;/api/v1/testuser1&lt;BR /&gt;
/api/v2/testinfo1&lt;/P&gt;

&lt;P&gt;This approach seems to be better But I have a question.&lt;/P&gt;

&lt;P&gt;Do I replace testuser1 or testinfo2 with .* something like that?  you have defined eval and stored only those two values.  cause each time the value will differ and there will be hundreds of unique values. How do I approach that case? Thanks. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 02:52:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495279#M32426</guid>
      <dc:creator>rkrish71</dc:creator>
      <dc:date>2020-03-18T02:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Replace Command in Drilldown with Unique Values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495280#M32427</link>
      <description>&lt;P&gt;It is just sample data. You need to replace query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw=" api
 /api/v1/testuser1
 /api/v2/testinfo1" 
| multikv forceheader=1 
| eval api=replace(api, "/[\w]+$", "/unique_value")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your base search&amp;gt; | eval api=replace(api, "/[\w]+$", "/unique_value")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Mar 2020 03:16:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Use-Replace-Command-in-Drilldown-with-Unique-Values/m-p/495280#M32427</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-18T03:16:48Z</dc:date>
    </item>
  </channel>
</rss>

