<?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: How can I delete the event data when some event fields value is &amp;quot;None&amp;quot; or &amp;quot;Nan&amp;quot; in Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-delete-the-event-data-when-some-event-fields-value-is/m-p/465985#M140218</link>
    <description>&lt;P&gt;If you want to remove those field values at search time you can remove using following query-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|eval field=if(field="None" OR field="Nan" OR field="",NULL,field )|where isnotnull(field)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here replace field with actual field name&lt;/P&gt;</description>
    <pubDate>Thu, 28 May 2020 05:20:03 GMT</pubDate>
    <dc:creator>493669</dc:creator>
    <dc:date>2020-05-28T05:20:03Z</dc:date>
    <item>
      <title>How can I delete the event data when some event fields value is "None" or "Nan" in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-delete-the-event-data-when-some-event-fields-value-is/m-p/465984#M140217</link>
      <description>&lt;P&gt;Hello Guys,&lt;BR /&gt;Sorry for blasting...&lt;BR /&gt;When I input data into Splunk, I find some field values in the events are "None" or "Nan" or "". How can I delete these events which contain the blank values in Splunk? Or is there any way to drop these events when inputting these data?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2020 18:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-delete-the-event-data-when-some-event-fields-value-is/m-p/465984#M140217</guid>
      <dc:creator>samfisher1</dc:creator>
      <dc:date>2020-06-06T18:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete the event data when some event fields value is "None" or "Nan" in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-delete-the-event-data-when-some-event-fields-value-is/m-p/465985#M140218</link>
      <description>&lt;P&gt;If you want to remove those field values at search time you can remove using following query-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|eval field=if(field="None" OR field="Nan" OR field="",NULL,field )|where isnotnull(field)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here replace field with actual field name&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 05:20:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-delete-the-event-data-when-some-event-fields-value-is/m-p/465985#M140218</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2020-05-28T05:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete the event data when some event fields value is "None" or "Nan" in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-delete-the-event-data-when-some-event-fields-value-is/m-p/465986#M140219</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/46086"&gt;@samfisher1&lt;/a&gt;,&lt;BR /&gt;
You have three ways to delete events in Splunk:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;before indexing;&lt;/LI&gt;
&lt;LI&gt;from Splunk interface using the delete command;&lt;/LI&gt;
&lt;LI&gt;in CLi using the clean command.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;In detail:&lt;/P&gt;

&lt;P&gt;1)&lt;BR /&gt;
you can filter events before indexing using the steps described at &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.4/Forwarding/Routeandfilterdatad#Filter_event_data_and_send_to_queues" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.4/Forwarding/Routeandfilterdatad#Filter_event_data_and_send_to_queues&lt;/A&gt; , in few words you have to find a regex to take all the events (if you share a sample of the logs to filter I can help you) and put in &lt;STRONG&gt;props.conf&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
TRANSFORMS-null= setnull
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In &lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX = your_regex
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As regex you could use &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = None|Nan
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for the first two values, but per the value="" I cannot help you without a sample of these logs.&lt;/P&gt;

&lt;P&gt;This is the best way to filter events because you do this before indexing so you don't consume license.&lt;/P&gt;

&lt;P&gt;2)&lt;BR /&gt;
you can use the delete command at the end of a search but it isn't an efficient method because it's a logic deletion, so the events remain in the buckets and you already consumed license for indexing.&lt;BR /&gt;
In addition, it isn't a best practice to give the role "can_delete" to many users, so i cannot hint this method: I use it only in development on test archives and with much, much attention, changing my role to can_delete only for a short time!&lt;/P&gt;

&lt;P&gt;3)&lt;BR /&gt;
the third method, I think, isn't useful for you because permits to delete an entire index, it isn't selective, and anyway you already indexed logs, so you consumed license.&lt;/P&gt;

&lt;P&gt;At the end the best approach is the first one.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:32:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-delete-the-event-data-when-some-event-fields-value-is/m-p/465986#M140219</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-30T05:32:44Z</dc:date>
    </item>
  </channel>
</rss>

