<?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 do I use regular expression search results from one index search and use it in another? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-do-I-use-regular-expression-search-results-from-one-index/m-p/242358#M72100</link>
    <description>&lt;P&gt;Can you accept if either of the answers worked for you?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2016 05:18:42 GMT</pubDate>
    <dc:creator>Murali2888</dc:creator>
    <dc:date>2016-02-03T05:18:42Z</dc:date>
    <item>
      <title>how do I use regular expression search results from one index search and use it in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-do-I-use-regular-expression-search-results-from-one-index/m-p/242354#M72096</link>
      <description>&lt;P&gt;How do I use regular expression search results from one index search and use it in another? The following does not work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*rest*" [ search index=ws host="*ws*" sourcetype="WS*" (/service/click)  | rex field=_raw "^(?:(nonce)*){10}\s+\w+=(?P&amp;lt;my_nonce&amp;gt;.+)" | fields my_nonce]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I followed this example at  &lt;A href="https://answers.splunk.com/answers/65336/how-do-i-use-the-output-from-one-serch-as-input-to-another.html?utm_source=typeahead&amp;amp;utm_medium=newquestion&amp;amp;utm_campaign=no_votes_sort_relev" target="_blank"&gt;https://answers.splunk.com/answers/65336/how-do-i-use-the-output-from-one-serch-as-input-to-another.html?utm_source=typeahead&amp;amp;utm_medium=newquestion&amp;amp;utm_campaign=no_votes_sort_relev&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;index=other_index [search index=ironmail some_search_string | fields email_address ] &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:30:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-do-I-use-regular-expression-search-results-from-one-index/m-p/242354#M72096</guid>
      <dc:creator>krishna81m</dc:creator>
      <dc:date>2020-09-29T08:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: how do I use regular expression search results from one index search and use it in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-do-I-use-regular-expression-search-results-from-one-index/m-p/242355#M72097</link>
      <description>&lt;P&gt;You can try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; host="*rest*" [ search index=ws host="*ws*" sourcetype="WS*" (/service/click)  | rex field=_raw "^(?:(nonce)*){10}\s+\w+=(?P&amp;lt;my_nonce&amp;gt;.+)" |return my_nonce]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also modify this a bit to use return $my_nonece, and modify the search to be &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*rest*" my_nonce=[ search index=ws host="*ws*" sourcetype="WS*" (/service/click)  | rex field=_raw "^(?:(nonce)*){10}\s+\w+=(?P&amp;lt;my_nonce&amp;gt;.+)" |return $my_nonce]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using $ will return the actual value, where as return itself will throw back the full field.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Return"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Return&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Be aware of the behavior of return, as it uses head to return the first result. &lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2016 06:56:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-do-I-use-regular-expression-search-results-from-one-index/m-p/242355#M72097</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2016-01-23T06:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: how do I use regular expression search results from one index search and use it in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-do-I-use-regular-expression-search-results-from-one-index/m-p/242356#M72098</link>
      <description>&lt;P&gt;Does your main search has a field called my_nonce?? If yes then your source should work fine (provided subsearch works fine). If there is no my_nonce field and you want to do a text search try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*rest*" [ search index=ws host="*ws*" sourcetype="WS*" (/service/click)  | rex field=_raw "^(?:(nonce)*){10}\s+\w+=(?P&amp;lt;my_nonce&amp;gt;.+)" | stats count by my_nonce | table my_nonce | rename my_nonce as search ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:30:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-do-I-use-regular-expression-search-results-from-one-index/m-p/242356#M72098</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T08:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: how do I use regular expression search results from one index search and use it in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-do-I-use-regular-expression-search-results-from-one-index/m-p/242357#M72099</link>
      <description>&lt;P&gt;You can use the below as well.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*rest*" [ search index=ws host="*ws*" sourcetype="WS*" (/service/click)  | rex field=_raw "^(?:(nonce)*){10}\s+\w+=(?P&amp;lt;my_nonce&amp;gt;.+)" | rename my_nonce as query | fields query]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For example, if my_nonce has values like &lt;CODE&gt;foo&lt;/CODE&gt; and &lt;CODE&gt;bar&lt;/CODE&gt;, the query will return&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=*rest*  "foo" OR "bar"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jan 2016 02:41:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-do-I-use-regular-expression-search-results-from-one-index/m-p/242357#M72099</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2016-01-25T02:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: how do I use regular expression search results from one index search and use it in another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-do-I-use-regular-expression-search-results-from-one-index/m-p/242358#M72100</link>
      <description>&lt;P&gt;Can you accept if either of the answers worked for you?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2016 05:18:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-do-I-use-regular-expression-search-results-from-one-index/m-p/242358#M72100</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2016-02-03T05:18:42Z</dc:date>
    </item>
  </channel>
</rss>

