<?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: Defining all values in a  tables column as a global token to use anytime... in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474638#M192499</link>
    <description>&lt;P&gt;@onegame999,&lt;/P&gt;

&lt;P&gt;Couldn't find any method which passes multiple values at a time by default. However, tried this workaround and seems to be working. &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Combining values of column to an additional field (field with "_" is hidden in the output) &lt;/LI&gt;
&lt;LI&gt;Set the values to a token once the search is done&lt;/LI&gt;
&lt;LI&gt;Use the token in the subsequent searches&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Here is a run anywhere example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;ColumnValues&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;index=_internal|stats count by sourcetype|eventstats values(sourcetype) as _additional&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;set token="column_values"&amp;gt;$result._additional$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&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;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|makeresults|eval column="$column_values$"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-1m&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;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Its currently produces a comma(,) separated list but that can be processed using mv commands based on how you want to use them later.&lt;BR /&gt;
It should be fine for a small datasets but haven't tested against a large dataset&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Other option is to write the results of first search to a temp lookup and source that lookup in the second search&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Sat, 02 Nov 2019 02:54:39 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2019-11-02T02:54:39Z</dc:date>
    <item>
      <title>Defining all values in a  tables column as a global token to use anytime...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474637#M192498</link>
      <description>&lt;P&gt;I been looking for a while now for an answer , I have read just about everything but I am not getting what I am lookin for.&lt;/P&gt;

&lt;P&gt;My first panel search is simply an  Inputlookup csv  predefined in Splunk that updates nightly with new data..&lt;BR /&gt;
The user controls the results table with the time  picker....what ever dates they choose a table is produced.... so far so good....&lt;/P&gt;

&lt;P&gt;What I want to do is grab an entire column/ field that's returned and use all the values in a second panel...&lt;BR /&gt;
Just simply being able to use  | Table $Customers$ in the second panel or use that list with a where clause in second panel....&lt;/P&gt;

&lt;P&gt;I don't want a drill down or click value or anything I just want to use the whole list / column in the second panel.. nothing fancy&lt;/P&gt;

&lt;P&gt;my code..&lt;/P&gt;

&lt;P&gt;| inputlookup Customers_2019.csv &lt;BR /&gt;
| search = "Products"  = sold&lt;BR /&gt;
| eval _time = Purchase_date&lt;BR /&gt;
| sort - DateCreated &lt;BR /&gt;
| table Customers&lt;/P&gt;

&lt;P&gt;which produces the list I want...&lt;/P&gt;

&lt;P&gt;I want to simply pass the Customers to a token to use later.. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:48:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474637#M192498</guid>
      <dc:creator>onegame999</dc:creator>
      <dc:date>2020-09-30T02:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Defining all values in a  tables column as a global token to use anytime...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474638#M192499</link>
      <description>&lt;P&gt;@onegame999,&lt;/P&gt;

&lt;P&gt;Couldn't find any method which passes multiple values at a time by default. However, tried this workaround and seems to be working. &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Combining values of column to an additional field (field with "_" is hidden in the output) &lt;/LI&gt;
&lt;LI&gt;Set the values to a token once the search is done&lt;/LI&gt;
&lt;LI&gt;Use the token in the subsequent searches&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Here is a run anywhere example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;ColumnValues&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;index=_internal|stats count by sourcetype|eventstats values(sourcetype) as _additional&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;set token="column_values"&amp;gt;$result._additional$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&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;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|makeresults|eval column="$column_values$"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-1m&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;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Its currently produces a comma(,) separated list but that can be processed using mv commands based on how you want to use them later.&lt;BR /&gt;
It should be fine for a small datasets but haven't tested against a large dataset&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Other option is to write the results of first search to a temp lookup and source that lookup in the second search&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Sat, 02 Nov 2019 02:54:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474638#M192499</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-11-02T02:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Defining all values in a  tables column as a global token to use anytime...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474639#M192500</link>
      <description>&lt;P&gt;You don't need to make the field prefixed with an underscore, an alternative is to add the  element to control the table fields, i.e.&lt;/P&gt;

&lt;P&gt;index=_internal|stats count by sourcetype&lt;BR /&gt;
 |eventstats values(sourcetype) as sourcetypes&lt;/P&gt;

&lt;P&gt;and then just list the fields you want&lt;BR /&gt;
&lt;CODE&gt;&amp;lt;fields&amp;gt;sourcetype,count&amp;lt;/fields&amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Viz/PanelreferenceforSimplifiedXML#table"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/Viz/PanelreferenceforSimplifiedXML#table&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2019 04:56:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474639#M192500</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2019-11-02T04:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Defining all values in a  tables column as a global token to use anytime...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474640#M192501</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| inputlookup Customers_2019.csv
| search Products = "sold"
| table Customers
| format
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, How about this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;done&amp;gt;
   &amp;lt;set token="your_token"&amp;gt;$result.search$&amp;lt;/set&amp;gt;
 &amp;lt;/done&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Not &lt;CODE&gt;Customers&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2019 07:22:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474640#M192501</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-02T07:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Defining all values in a  tables column as a global token to use anytime...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474641#M192502</link>
      <description>&lt;P&gt;@bowesmana , you are right but values which are not present in the result table wont be available in the $result. token. Try it&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2019 08:07:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474641#M192502</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-11-02T08:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Defining all values in a  tables column as a global token to use anytime...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474642#M192503</link>
      <description>&lt;P&gt;Not sure I get you @renjith.nair . If the results are not in the table then naturally they would not be in the token. Is there another possibility?&lt;/P&gt;</description>
      <pubDate>Sun, 03 Nov 2019 08:01:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474642#M192503</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2019-11-03T08:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Defining all values in a  tables column as a global token to use anytime...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474643#M192504</link>
      <description>&lt;P&gt;@bowesmana , thats why I used _ variable.  It doesnt display in the result table but will be available in the result set token&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 12:35:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474643#M192504</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-11-07T12:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Defining all values in a  tables column as a global token to use anytime...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474644#M192505</link>
      <description>&lt;P&gt;@renjith.nair My point was that using the fields XML statement allows you to control what values are &lt;STRONG&gt;&lt;EM&gt;SHOWN&lt;/EM&gt;&lt;/STRONG&gt; in the table, regardless of what fields are in the SPL. You can have any number of fields in the results, but only show a subset of these. All fields in the results are then available to tokens.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 08:42:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Defining-all-values-in-a-tables-column-as-a-global-token-to-use/m-p/474644#M192505</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2019-11-08T08:42:16Z</dc:date>
    </item>
  </channel>
</rss>

