<?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: Conditional search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Conditional-search/m-p/652771#M225581</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=patch sourcetype=device device_group=PRE* OR device_group=BFV*
| where (match(host,"bradley-lab") AND searchmatch(device_group=PRE*)) OR (NOT match(host,"bradley-lab") AND searchmatch(device_group=BFV*))

| dedup extracted_host
| eval my_time=_time
| convert timeformat="%Y-%m-%d %H:%M:%S" ctime(my_time)
| rename extracted_host as device_Name, my_time as "Date Posted"
| table "Date Posted" device_group device_Name current_system_version latest_system_version status&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 01 Aug 2023 21:30:42 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-08-01T21:30:42Z</dc:date>
    <item>
      <title>How to create the Conditional search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Conditional-search/m-p/652770#M225580</link>
      <description>&lt;P&gt;I have looked through the forums and can't find exactly what I am looking for.&lt;BR /&gt;&lt;BR /&gt;Here is my search and what I think should work, but I don't think I completely understand multisearch.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| multisearch
[ search index=patch sourcetype=device host="bradley-lab" device_group=PRE*
| where match(host,"bradley-lab")]
[ search index=patch sourcetype=device host="bradley-lab" device_group=BFV*
| where NOT match(host,"bradley-lab")]

| dedup extracted_host
| eval my_time=_time
| convert timeformat="%Y-%m-%d %H:%M:%S" ctime(my_time)
| rename extracted_host as device_Name, my_time as "Date Posted"
| table "Date Posted" device_group device_Name current_system_version latest_system_version status&lt;/LI-CODE&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;&lt;BR /&gt;&lt;BR /&gt;host=bradley-lab will come from a token drilldown on a dashboard&lt;BR /&gt;&lt;BR /&gt;if the host is bradley-lab I want it to show all devices with the device_group=PRE&lt;BR /&gt;and if the host is anything else, I want it to show all devices with device_group=BFV&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 19:46:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Conditional-search/m-p/652770#M225580</guid>
      <dc:creator>tcpcannon</dc:creator>
      <dc:date>2023-08-02T19:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Conditional-search/m-p/652771#M225581</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=patch sourcetype=device device_group=PRE* OR device_group=BFV*
| where (match(host,"bradley-lab") AND searchmatch(device_group=PRE*)) OR (NOT match(host,"bradley-lab") AND searchmatch(device_group=BFV*))

| dedup extracted_host
| eval my_time=_time
| convert timeformat="%Y-%m-%d %H:%M:%S" ctime(my_time)
| rename extracted_host as device_Name, my_time as "Date Posted"
| table "Date Posted" device_group device_Name current_system_version latest_system_version status&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Aug 2023 21:30:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Conditional-search/m-p/652771#M225581</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-01T21:30:42Z</dc:date>
    </item>
  </channel>
</rss>

