<?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: Remove only fields that do not have suffix in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Remove-only-fields-that-do-not-have-suffix/m-p/667027#M228828</link>
    <description>&lt;LI-CODE lang="markup"&gt;| makeresults
| eval aa1=1, aa2=2, aa1x=3, aa2x=4, b=5
| rename aa*x as xaa*x
| fields - aa*
| rename xaa*x as aa*x&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 01 Nov 2023 15:10:13 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-11-01T15:10:13Z</dc:date>
    <item>
      <title>Remove only fields that do not have suffix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-only-fields-that-do-not-have-suffix/m-p/667020#M228824</link>
      <description>&lt;P&gt;Basically I have a search with a lot of fields, similar to this example:&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;| makeresults
| eval aa1=1, aa2=2, aa1x=3, aa2x=4, b=5&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from this I would basically like to keep everything except for aa* that does not contain the suffix x. I tried&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;| fields -aa* aa*x&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as well as similar approaches, but they do not work:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1) either deleting all aa* (including aa*x)&lt;/P&gt;&lt;P&gt;2) not keeping b or&lt;/P&gt;&lt;P&gt;3)not deleting aa* at all.&lt;/P&gt;&lt;P&gt;I would know how to solve this with regex: "aa.+(?&amp;lt;!x)$" as can be seen here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://regex101.com/r/JfVHCJ/latest" target="_blank" rel="noopener"&gt;https://regex101.com/r/JfVHCJ/latest&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Is there any SPL equivalent?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 14:31:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-only-fields-that-do-not-have-suffix/m-p/667020#M228824</guid>
      <dc:creator>duesser</dc:creator>
      <dc:date>2023-11-01T14:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Remove only fields that do not have suffix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-only-fields-that-do-not-have-suffix/m-p/667022#M228825</link>
      <description>&lt;P&gt;Have you tried this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval aa1=1, aa2=2, aa1x=3, aa2x=4, b=5
| fields + aa*x b&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 01 Nov 2023 14:59:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-only-fields-that-do-not-have-suffix/m-p/667022#M228825</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-11-01T14:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Remove only fields that do not have suffix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-only-fields-that-do-not-have-suffix/m-p/667026#M228827</link>
      <description>&lt;P&gt;While this is possible, there are a lot of b's in the real search and I am looking for a way to not have to write those out individually. - I would like a negative formulation if possible&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 15:05:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-only-fields-that-do-not-have-suffix/m-p/667026#M228827</guid>
      <dc:creator>duesser</dc:creator>
      <dc:date>2023-11-01T15:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Remove only fields that do not have suffix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-only-fields-that-do-not-have-suffix/m-p/667027#M228828</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults
| eval aa1=1, aa2=2, aa1x=3, aa2x=4, b=5
| rename aa*x as xaa*x
| fields - aa*
| rename xaa*x as aa*x&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 01 Nov 2023 15:10:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-only-fields-that-do-not-have-suffix/m-p/667027#M228828</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-11-01T15:10:13Z</dc:date>
    </item>
  </channel>
</rss>

