<?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 How can I filter the field only from certain events? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-the-field-only-from-certain-events/m-p/331555#M61415</link>
    <description>&lt;P&gt;Hello! How can I filter the field only from certain events? There are a lot of events with the same fields, I need to filter these fields when indexing, only in some events.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Oct 2017 07:34:05 GMT</pubDate>
    <dc:creator>bagaeva</dc:creator>
    <dc:date>2017-10-24T07:34:05Z</dc:date>
    <item>
      <title>How can I filter the field only from certain events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-the-field-only-from-certain-events/m-p/331555#M61415</link>
      <description>&lt;P&gt;Hello! How can I filter the field only from certain events? There are a lot of events with the same fields, I need to filter these fields when indexing, only in some events.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 07:34:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-the-field-only-from-certain-events/m-p/331555#M61415</guid>
      <dc:creator>bagaeva</dc:creator>
      <dc:date>2017-10-24T07:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter the field only from certain events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-the-field-only-from-certain-events/m-p/331556#M61416</link>
      <description>&lt;P&gt;please provide sample raw data in your post, and how you want the output so we can put the correct search/filter/regex&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 11:51:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-the-field-only-from-certain-events/m-p/331556#M61416</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-10-24T11:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter the field only from certain events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-the-field-only-from-certain-events/m-p/331557#M61417</link>
      <description>&lt;P&gt;two events: &lt;/P&gt;

&lt;P&gt;1508735029.189 d = a enm_val = 25440 event = vil gnr = w gnr_l = 91 serv = en_1 sn = o u_cl = 19 u_cr = 56 u_geo = RU u_id = 160370 u_mn = 2423432 u_pvp = 6433109 u_sd = 4101827 u_st = 1418129 u_wd = 2652063 u_wl = 91 vil = st vil_l = 16 win = 1624 &lt;/P&gt;

&lt;P&gt;1508735662.348 d = a event = cup fI = "2017-10-22 17: 26: 37.000" serv = ru_1 sn = u_cl = 1 u_cr = 300 u_geo = RU u_id = 1256228 u_mn = 595 u_pvp = 0 u_sd = 600 u_st = 700 u_wd = 760 u_wl = 1 &lt;/P&gt;

&lt;P&gt;The field u_cr = 56 must be removed only from the first (event = vil). In the second (event = cup), it should not change. &lt;/P&gt;

&lt;P&gt;After deleting the first event looks like: &lt;/P&gt;

&lt;P&gt;1508735029.189 d = a enm_val = 25440 event = vil gnr = w gnr_l = 91 serv = en_1 sn = o u_cl = 19 u_geo = RU u_id = 160370 u_mn = 2423432 u_pvp = 6433109 u_sd = 4101827 u_st = 1418129 u_wd = 2652063 u_wl = 91 vil = st vil_l = 16 win = 1624&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:28:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-the-field-only-from-certain-events/m-p/331557#M61417</guid>
      <dc:creator>bagaeva</dc:creator>
      <dc:date>2020-09-29T16:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter the field only from certain events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-the-field-only-from-certain-events/m-p/331558#M61418</link>
      <description>&lt;P&gt;The answer here is NOT to change the field extractions of the original, raw data.  It sounds like you want to treat the value of &lt;CODE&gt;u_cr&lt;/CODE&gt; differently for some values of event than those from other values of event.  In that case, you could just change the value of &lt;CODE&gt;u_cr&lt;/CODE&gt; for those events dynamically at search time to get what you need.  For example, if you were summing &lt;CODE&gt;u_cr&lt;/CODE&gt; but wanted to exclude the value of &lt;CODE&gt;u_cr&lt;/CODE&gt; from that summation for events where the event field equals "vil", you could just set &lt;CODE&gt;u_cr&lt;/CODE&gt; to zero for those events right in the search; for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval u_cr=if(event="vil", 0, u_cr) | stats sum(u_cr)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope that helps.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 22:20:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-the-field-only-from-certain-events/m-p/331558#M61418</guid>
      <dc:creator>khaynes_splunk</dc:creator>
      <dc:date>2017-10-25T22:20:54Z</dc:date>
    </item>
  </channel>
</rss>

