<?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: Is it possible to use | format to get != in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-format-to-get/m-p/645817#M223598</link>
    <description>&lt;P&gt;After thinking about it more for a bit I think this should work and do the same thing as != for each field/value pair but still allows me to use | format.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| format "ip=* AND (NOT" "" "" "" "NOT" ")"&lt;/LI-CODE&gt;&lt;P&gt;I think this should give me the same results. Does this look right?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2023 20:38:49 GMT</pubDate>
    <dc:creator>fredclown</dc:creator>
    <dc:date>2023-06-05T20:38:49Z</dc:date>
    <item>
      <title>Is it possible to use | format to get !=?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-format-to-get/m-p/645814#M223597</link>
      <description>&lt;P&gt;I have a search and in the initial part of the search I have a subquery that returns some IP addresses formatted like this using the | format command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(ip="10.10.10.10 OR ip="1.1.1.1" OR ip="2.2.2.2")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a different search where I want to negate it. Is there a way to do this? I know that the format command does allow you to do things like this ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(NOT ip="10.10.10.10 NOT ip="1.1.1.1" NOT ip="2.2.2.2")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However,&amp;nbsp;NOT ip="value" is not the same as ip!="value" in Splunk land. So, I guess I'm wondering if anyone has a great way in a subquery to pass back the field/value pairs with != rather than =. My hunch is | format can't do it, but maybe there is a different way. Hope that makes sense.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 20:36:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-format-to-get/m-p/645814#M223597</guid>
      <dc:creator>fredclown</dc:creator>
      <dc:date>2023-06-05T20:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use | format to get !=</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-format-to-get/m-p/645817#M223598</link>
      <description>&lt;P&gt;After thinking about it more for a bit I think this should work and do the same thing as != for each field/value pair but still allows me to use | format.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| format "ip=* AND (NOT" "" "" "" "NOT" ")"&lt;/LI-CODE&gt;&lt;P&gt;I think this should give me the same results. Does this look right?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 20:38:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-format-to-get/m-p/645817#M223598</guid>
      <dc:creator>fredclown</dc:creator>
      <dc:date>2023-06-05T20:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use | format to get !=?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-format-to-get/m-p/645818#M223599</link>
      <description>&lt;P&gt;Remember that if your subsearch returns a field called "search", it's returned verbatim to the outer search. So you can craft a search string yourself if the format command isn't sufficient.&lt;/P&gt;&lt;P&gt;Run-anywhere example:&lt;/P&gt;&lt;PRE&gt;| makeresults count=20&lt;BR /&gt;| streamstats count &lt;BR /&gt;| search &lt;BR /&gt;[| makeresults count=10 &lt;BR /&gt;| streamstats count&lt;BR /&gt;| table count&lt;BR /&gt;| eval count="count!=".count&lt;BR /&gt;| stats values(count) as search&lt;BR /&gt;| eval search=mvjoin(search," AND ")]&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Jun 2023 20:48:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-format-to-get/m-p/645818#M223599</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-06-05T20:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use | format to get !=?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-format-to-get/m-p/645824#M223603</link>
      <description>&lt;P&gt;That is a good option. I think my way would&amp;nbsp; work as well, but I like the output of something like this better. It looks cleaner.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 22:28:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-format-to-get/m-p/645824#M223603</guid>
      <dc:creator>fredclown</dc:creator>
      <dc:date>2023-06-05T22:28:10Z</dc:date>
    </item>
  </channel>
</rss>

