<?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: Subsearch to only return multiple field values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-to-only-return-multiple-field-values/m-p/563547#M196328</link>
    <description>&lt;P&gt;groovy! please accept as solution?&lt;/P&gt;</description>
    <pubDate>Mon, 16 Aug 2021 22:43:28 GMT</pubDate>
    <dc:creator>dwaddle</dc:creator>
    <dc:date>2021-08-16T22:43:28Z</dc:date>
    <item>
      <title>Subsearch to only return multiple field values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-to-only-return-multiple-field-values/m-p/563267#M196251</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to only return the values of certain fields to be used in a subsearch. The problem I'm encountering, is that I have multiple values from different fields which I want to extract.&lt;/P&gt;&lt;P&gt;I have 4 fields - src, src_port, dst, dst_port&lt;/P&gt;&lt;P&gt;If I table out the results and use format, my search reads as such:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"src"="&amp;lt;IP&amp;gt;" AND "src_port"="&amp;lt;port&amp;gt;" AND&amp;nbsp;"dst"="&amp;lt;IP&amp;gt;" AND&amp;nbsp;"dst_port"="&amp;lt;port&amp;gt;"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What I want is only the values:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&amp;lt;ip&amp;gt;" AND&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;lt;port&amp;gt;" AND&amp;nbsp;"&amp;lt;ip&amp;gt;" AND&amp;nbsp;"&amp;lt;port&amp;gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I've tried using:&lt;BR /&gt;return 10 $src $src_port $dst $dst_port&lt;BR /&gt;which gives me the desired output, but encases the entire output in one set of quotations and not individually as per the same output that would be created using the table command&lt;/P&gt;&lt;P&gt;I've also tried using:&lt;/P&gt;&lt;P&gt;eval query = src. " " .src_port. " " .dst. " " .dst_port&amp;nbsp;&lt;/P&gt;&lt;P&gt;which gets me closer, but then outputs each four values encased within the quotations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me out with the desired output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Aug 2021 02:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-to-only-return-multiple-field-values/m-p/563267#M196251</guid>
      <dc:creator>SailorManDan</dc:creator>
      <dc:date>2021-08-14T02:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch to only return multiple field values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-to-only-return-multiple-field-values/m-p/563282#M196258</link>
      <description>&lt;P&gt;The "query" field is special.&amp;nbsp; Any field named "query" gets its field name stripped going through format.&amp;nbsp; Try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|  makeresults 
|  eval src_ip="1.2.3.4", src_port=1234, dest_ip="5.6.7.8", dest_port=5678 
|  eval query=mvappend(src_ip,src_port,dest_ip,dest_port) 
|  fields query
|  format mvsep="AND"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last 3 lines are the relevant part, makeresults is just there to help me mock up some stuff.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Aug 2021 15:03:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-to-only-return-multiple-field-values/m-p/563282#M196258</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2021-08-14T15:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch to only return multiple field values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-to-only-return-multiple-field-values/m-p/563340#M196277</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/278"&gt;@dwaddle&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's got it!&lt;/P&gt;&lt;P&gt;This is precisely what I was going for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for you help.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 21:06:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-to-only-return-multiple-field-values/m-p/563340#M196277</guid>
      <dc:creator>SailorManDan</dc:creator>
      <dc:date>2021-08-15T21:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch to only return multiple field values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-to-only-return-multiple-field-values/m-p/563547#M196328</link>
      <description>&lt;P&gt;groovy! please accept as solution?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 22:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-to-only-return-multiple-field-values/m-p/563547#M196328</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2021-08-16T22:43:28Z</dc:date>
    </item>
  </channel>
</rss>

