<?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 How to extract a string from a field to use in another search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-to-use-in-another-search/m-p/206979#M60309</link>
    <description>&lt;P&gt;So I am new to Splunk, but cannot seem to find the answer to this likely simple search question.  So I need to search for a string, then use that value in a second search.  Assuming this will just be a subsearch.&lt;/P&gt;

&lt;P&gt;For Example:  &lt;/P&gt;

&lt;P&gt;I can use this search to pull the piece of information I need - but it labels it as a field called &lt;STRONG&gt;callID&lt;/STRONG&gt;.  We have not set up callID as a field yet it seems, and I don't want to rock the boat on that just yet, so I think I just need it as a string to use in the next search.  Would I look for that "callID" part using regex?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sip-ra ani 18005551111 17775559999 ConfJoinNote | rex field=_raw "\(?&amp;lt;callID&amp;gt;.*)\&amp;lt;\/callLegSessionID\&amp;gt;"  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that would return this as callID:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;204.466.sip_reservationless_conference.102@64.214.111.111
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then my next search would have the above as a subsearch like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sip-ra [subsearch to get the callID string] "audio" "digits"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I just can't figure out how to get it to use that 204.466***  as part of that next search?&lt;/P&gt;

&lt;P&gt;thank you!&lt;/P&gt;

&lt;P&gt;skiller&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2016 17:05:10 GMT</pubDate>
    <dc:creator>skiller1234</dc:creator>
    <dc:date>2016-08-05T17:05:10Z</dc:date>
    <item>
      <title>How to extract a string from a field to use in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-to-use-in-another-search/m-p/206979#M60309</link>
      <description>&lt;P&gt;So I am new to Splunk, but cannot seem to find the answer to this likely simple search question.  So I need to search for a string, then use that value in a second search.  Assuming this will just be a subsearch.&lt;/P&gt;

&lt;P&gt;For Example:  &lt;/P&gt;

&lt;P&gt;I can use this search to pull the piece of information I need - but it labels it as a field called &lt;STRONG&gt;callID&lt;/STRONG&gt;.  We have not set up callID as a field yet it seems, and I don't want to rock the boat on that just yet, so I think I just need it as a string to use in the next search.  Would I look for that "callID" part using regex?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sip-ra ani 18005551111 17775559999 ConfJoinNote | rex field=_raw "\(?&amp;lt;callID&amp;gt;.*)\&amp;lt;\/callLegSessionID\&amp;gt;"  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that would return this as callID:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;204.466.sip_reservationless_conference.102@64.214.111.111
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then my next search would have the above as a subsearch like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sip-ra [subsearch to get the callID string] "audio" "digits"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I just can't figure out how to get it to use that 204.466***  as part of that next search?&lt;/P&gt;

&lt;P&gt;thank you!&lt;/P&gt;

&lt;P&gt;skiller&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 17:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-to-use-in-another-search/m-p/206979#M60309</guid>
      <dc:creator>skiller1234</dc:creator>
      <dc:date>2016-08-05T17:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a field to use in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-to-use-in-another-search/m-p/206980#M60310</link>
      <description>&lt;P&gt;Apologies - the first search is incomplete:&lt;/P&gt;

&lt;P&gt;index=sip-ra ani 18005551111 17775559999 ConfJoinNotify | rex field=_raw "(?.*)&amp;lt;\/callLegSessionID&amp;gt;" &lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 17:08:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-to-use-in-another-search/m-p/206980#M60310</guid>
      <dc:creator>skiller1234</dc:creator>
      <dc:date>2016-08-05T17:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a field to use in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-to-use-in-another-search/m-p/206981#M60311</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sip-ra [ search index=sip-ra ani 18005551111 17775559999 ConfJoinNotify | rex field=_raw "(?&amp;lt;callID&amp;gt;.*)\&amp;lt;\/callLegSessionID\&amp;gt;"  | table callID | rename callID as search] "audio" digits"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Aug 2016 17:15:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-to-use-in-another-search/m-p/206981#M60311</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-05T17:15:55Z</dc:date>
    </item>
  </channel>
</rss>

