<?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: Obtain data from  one search and store it in a variable to search data in another search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602435#M209697</link>
    <description>&lt;P&gt;Splunk doesn't have variables.&amp;nbsp; One can use tokens in a dashboard for an equivalent function, but that's not available in SPL.&lt;/P&gt;&lt;P&gt;One alternative is a subsearch.&amp;nbsp; A subsearch runs first and its results become part of the main search.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = idx  source = src data_stamp = B field1 = *lol* [ index = idx source = src data_stamp = A  field1 = *lol* | return TEST=Field2 ] | table field 3&lt;/LI-CODE&gt;&lt;P&gt;In this example, the subsearch is in square brackets and runs the specified search.&amp;nbsp; The return command creates a result with the Field2 field renamed to TEST.&amp;nbsp; The main search then becomes&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = idx  source = src data_stamp = B field1 = *lol* TEST=foo | table field 3&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 20 Jun 2022 16:56:56 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-06-20T16:56:56Z</dc:date>
    <item>
      <title>How to obtain data from  one search and store it in a variable to search data in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602432#M209694</link>
      <description>&lt;P&gt;My search is&amp;nbsp; like&amp;nbsp; this&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;index = idx source = src data_stamp = &lt;STRONG&gt;A&lt;/STRONG&gt;&amp;nbsp; field1 = *lol* | table Field2&amp;nbsp; &amp;nbsp;&lt;BR /&gt;--&amp;gt; This generates a column&amp;nbsp; with only value which i need to store in some &lt;STRONG&gt;$VAR&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index = idx&amp;nbsp; source = src data_stamp = &lt;STRONG&gt;B&lt;/STRONG&gt; field1 = *lol* TEST =&lt;STRONG&gt; $VAR&lt;/STRONG&gt; | table field 3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 18:06:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602432#M209694</guid>
      <dc:creator>paritoshs24</dc:creator>
      <dc:date>2022-06-21T18:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain data from  one search and store it in a variable to search data in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602433#M209695</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 16:31:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602433#M209695</guid>
      <dc:creator>paritoshs24</dc:creator>
      <dc:date>2022-06-20T16:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain data from  one search and store it in a variable to search data in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602435#M209697</link>
      <description>&lt;P&gt;Splunk doesn't have variables.&amp;nbsp; One can use tokens in a dashboard for an equivalent function, but that's not available in SPL.&lt;/P&gt;&lt;P&gt;One alternative is a subsearch.&amp;nbsp; A subsearch runs first and its results become part of the main search.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = idx  source = src data_stamp = B field1 = *lol* [ index = idx source = src data_stamp = A  field1 = *lol* | return TEST=Field2 ] | table field 3&lt;/LI-CODE&gt;&lt;P&gt;In this example, the subsearch is in square brackets and runs the specified search.&amp;nbsp; The return command creates a result with the Field2 field renamed to TEST.&amp;nbsp; The main search then becomes&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = idx  source = src data_stamp = B field1 = *lol* TEST=foo | table field 3&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 20 Jun 2022 16:56:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602435#M209697</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-06-20T16:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain data from  one search and store it in a variable to search data in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602448#M209700</link>
      <description>&lt;P&gt;It's worth pointing out that subsearches have their own limitations and - especially with big searches - are best avoided. The same result can quite often be achieved another way.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 18:15:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602448#M209700</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-06-20T18:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain data from  one search and store it in a variable to search data in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602561#M209745</link>
      <description>&lt;P&gt;Hi .... Its working...thanks for the help.&lt;BR /&gt;One&amp;nbsp; more thing to ad in subsearch :&lt;BR /&gt;Can I use IN command ??&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = idx  source = src data_stamp = B field1 = *lol* [ index = idx source = src data_stamp IN (A B)  field1 = *lol* | return TEST=Field2 ] | table field 3&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to pass multiple values of&amp;nbsp;&lt;STRONG&gt;data_stamp.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 08:10:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602561#M209745</guid>
      <dc:creator>paritoshs24</dc:creator>
      <dc:date>2022-06-21T08:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain data from  one search and store it in a variable to search data in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602562#M209746</link>
      <description>&lt;P&gt;Can you please point out how subsearch could be escaped ?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 08:12:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602562#M209746</guid>
      <dc:creator>paritoshs24</dc:creator>
      <dc:date>2022-06-21T08:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain data from  one search and store it in a variable to search data in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602616#M209757</link>
      <description>&lt;P&gt;Yes, the &lt;FONT face="courier new,courier"&gt;IN&lt;/FONT&gt; operator may be used in a subsearch.&lt;/P&gt;&lt;P&gt;If your problem is resolved, then please click the "Accept as Solution" button to help future readers.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 13:22:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-obtain-data-from-one-search-and-store-it-in-a-variable-to/m-p/602616#M209757</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-06-21T13:22:25Z</dc:date>
    </item>
  </channel>
</rss>

