<?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 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577981#M201409</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241051"&gt;@giorgioanastasi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Ciao Giorgio, it's a pleasure to speak with you!&lt;/P&gt;&lt;P&gt;please try something like this (that's similar to the solution of&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;.:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=whatever
| eval iphone9=if(model="iphone" AND match(os,"9\..*"),"Yes","No"),
| stats count(eval(iphone9="Yes") as iphoner dc(model) as modelcount by UserId
| search iphoner&amp;gt;0
| sort UserId&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 10 Dec 2021 07:17:15 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2021-12-10T07:17:15Z</dc:date>
    <item>
      <title>SubSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577789#M201351</link>
      <description>&lt;P&gt;Hi, I would have this need, that is to carry out a search that extracts all users who use iphone with SO = 9. * and then through the extracted users, search through them who has also used another device.&lt;/P&gt;&lt;P&gt;One solution would be to run the first search, get the list of all users and then do a new search with UsersId in input.&lt;/P&gt;&lt;P&gt;First search: search model = iphone so = 9. * | table UserId&lt;/P&gt;&lt;P&gt;Second search: search UserId IN (user list of the first search) model! = iphone&lt;/P&gt;&lt;P&gt;Would it be possible to do this extraction with just one search?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 15:18:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577789#M201351</guid>
      <dc:creator>giorgioanastasi</dc:creator>
      <dc:date>2021-12-08T15:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: SubSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577793#M201352</link>
      <description>&lt;DIV&gt;Give this a try:&lt;BR /&gt;&lt;BR /&gt;index=main&amp;nbsp;&lt;SPAN&gt;model! = iphone&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;[search index=main&amp;nbsp;&lt;SPAN&gt;model = iphone so = 9. *&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;| table UserId&lt;/SPAN&gt;&lt;BR /&gt;| dedup&amp;nbsp;&lt;SPAN&gt;UserId&lt;/SPAN&gt;&lt;BR /&gt;| table&amp;nbsp;&lt;SPAN&gt;UserId&lt;/SPAN&gt;&lt;BR /&gt;| format]&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Dec 2021 17:02:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577793#M201352</guid>
      <dc:creator>swong_splunk</dc:creator>
      <dc:date>2021-12-08T17:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: SubSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577818#M201357</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241051"&gt;@giorgioanastasi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main 
| stats count(eval(model="iphone" AND so="9.*")) AS iphone9 count(eval(NOT (model="iphone" AND so="9.*"))) AS not_iphone9 BY UserId&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 21:52:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577818#M201357</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-12-08T21:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: SubSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577876#M201374</link>
      <description>&lt;P&gt;Hi Giuseppe !! How are you ??&amp;nbsp;&lt;/P&gt;&lt;P&gt;you should know these files very well! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;unfortunately with your search it does not work, strangely:count(eval(SO="ios" AND VersSO="9.*")) AS iphone9 is always 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the search:&lt;/P&gt;&lt;P&gt;tag=Operativo | stats count(eval(SO="ios" AND VersSO="9.*")) AS iphone9 count(eval(NOT (SO="ios" AND VersSO="9.*"))) AS not_iphone9 BY NDG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 11:27:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577876#M201374</guid>
      <dc:creator>giorgioanastasi</dc:creator>
      <dc:date>2021-12-09T11:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: SubSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577947#M201391</link>
      <description>&lt;P&gt;I can think of several more or less ugly solutions to this problem &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But an elegant one is with eventstats&lt;/P&gt;&lt;PRE&gt;index=whatever&lt;BR /&gt;| eventstats dc(model) as modelcount by UserId&lt;BR /&gt;| search model=iphone so=9.* modelcount&amp;gt;1&lt;/PRE&gt;&lt;P&gt;That will hovewer only give you the iphone of users who use iphone 9.* as well as other phone. If that's enough because you only want the users themselves, that's ok.&lt;/P&gt;&lt;P&gt;If you also want to know what other phones they use, you might use similar trick to that proposed by &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;index=whatever&lt;BR /&gt;| eventstats dc(model) as modelcount count(eval(model="iphone" AND match(os,"9\..*")) as iphoner by UserId&lt;BR /&gt;| search iphoner&amp;gt;0 modelcount&amp;gt;1&lt;BR /&gt;| sort UserId&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Dec 2021 22:02:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577947#M201391</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-12-09T22:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: SubSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577981#M201409</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241051"&gt;@giorgioanastasi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Ciao Giorgio, it's a pleasure to speak with you!&lt;/P&gt;&lt;P&gt;please try something like this (that's similar to the solution of&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;.:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=whatever
| eval iphone9=if(model="iphone" AND match(os,"9\..*"),"Yes","No"),
| stats count(eval(iphone9="Yes") as iphoner dc(model) as modelcount by UserId
| search iphoner&amp;gt;0
| sort UserId&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 07:17:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577981#M201409</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-12-10T07:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: SubSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577992#M201418</link>
      <description>&lt;P&gt;So,&amp;nbsp;of the suggested searches, only this one (&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/182466" target="_self"&gt;&lt;SPAN class=""&gt;swong_splunk&lt;/SPAN&gt;&lt;/A&gt;) extracts the results (correct?):&lt;/P&gt;&lt;P&gt;tag=Operativo NOT(SO=ios AND VersSO="9.*") | dedup IdCliente | search&lt;BR /&gt;[search tag=Operativo (SO=ios AND VersSO="9.*")&lt;BR /&gt;| table IdCliente&lt;BR /&gt;| dedup IdCliente&lt;BR /&gt;| table IdCliente&lt;BR /&gt;| format]&lt;/P&gt;&lt;P&gt;This search extracts all customer codes that use ios 9. * but have also used a different device. I would need the opposite, that is, only customers who have used exclusively ios 9. * (but I can get them by difference from the list of those who use ios 9. * minus the search list above)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This research does not extract anything:&lt;/P&gt;&lt;P&gt;tag=Operativo&lt;BR /&gt;| eval iphone9=if(SO=ios AND match(VersSO,"9\..*"),"Yes","No")&lt;BR /&gt;| stats count(eval(iphone9="Yes")) as iphoner dc(model) as modelcount by&amp;nbsp;&amp;nbsp;IdCliente&lt;BR /&gt;| search iphoner&amp;gt;0&lt;BR /&gt;| sort IdCliente&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 09:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/577992#M201418</guid>
      <dc:creator>giorgioanastasi</dc:creator>
      <dc:date>2021-12-10T09:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: SubSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/578052#M201456</link>
      <description>&lt;P&gt;So,&amp;nbsp;of the suggested searches, only this one (&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/182466" target="_self"&gt;&lt;SPAN class=""&gt;swong_splunk&lt;/SPAN&gt;&lt;/A&gt;) extracts the results (correct?):&lt;/P&gt;&lt;P&gt;tag=Operativo NOT(SO=ios AND VersSO="9.*") | dedup IdCliente | search&lt;BR /&gt;[search tag=Operativo (SO=ios AND VersSO="9.*")&lt;BR /&gt;| table IdCliente&lt;BR /&gt;| dedup IdCliente&lt;BR /&gt;| table IdCliente&lt;BR /&gt;| format]&lt;/P&gt;&lt;P&gt;This search extracts all customer codes that use ios 9. * but have also used a different device. I would need the opposite, that is, only customers who have used exclusively ios 9. * (but I can get them by difference from the list of those who use ios 9. * minus the search list above)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This research does not extract anything:&lt;/P&gt;&lt;P&gt;tag=Operativo&lt;BR /&gt;| eval iphone9=if(SO=ios AND match(VersSO,"9\..*"),"Yes","No")&lt;BR /&gt;| stats count(eval(iphone9="Yes")) as iphoner dc(model) as modelcount by&amp;nbsp;&amp;nbsp;IdCliente&lt;BR /&gt;| search iphoner&amp;gt;0&lt;BR /&gt;| sort IdCliente&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 18:10:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch/m-p/578052#M201456</guid>
      <dc:creator>giorgioanastasi</dc:creator>
      <dc:date>2021-12-10T18:10:50Z</dc:date>
    </item>
  </channel>
</rss>

