<?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 using lookup data to filter event in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470441#M8142</link>
    <description>&lt;P&gt;in my look up table there is my maintenance date which i would like to remove it in my event is there a way that i can remove the event without deleting it from the index? &lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8657i956B1DEA15E025EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;above is my sample data , below is my maintenance date&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8658iADF85CDCCE07B8E0/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;is there a way that i can filter out my event from my lookup data so that those date which appear in my lookup table will not be seen in my event.&lt;/P&gt;

&lt;P&gt;hope you all can understand what i mean. thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Apr 2020 03:19:34 GMT</pubDate>
    <dc:creator>chookp</dc:creator>
    <dc:date>2020-04-09T03:19:34Z</dc:date>
    <item>
      <title>using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470441#M8142</link>
      <description>&lt;P&gt;in my look up table there is my maintenance date which i would like to remove it in my event is there a way that i can remove the event without deleting it from the index? &lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8657i956B1DEA15E025EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;above is my sample data , below is my maintenance date&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8658iADF85CDCCE07B8E0/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;is there a way that i can filter out my event from my lookup data so that those date which appear in my lookup table will not be seen in my event.&lt;/P&gt;

&lt;P&gt;hope you all can understand what i mean. thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2020 03:19:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470441#M8142</guid>
      <dc:creator>chookp</dc:creator>
      <dc:date>2020-04-09T03:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470442#M8143</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/48056"&gt;@chookp&lt;/a&gt;,&lt;BR /&gt;
let me understand: you want to update your  lookup based on the events in your index?&lt;BR /&gt;
If this is your need you could create a search that display the fields in your lookup and then update it using the outputlookup command, the question is: have you in your events all the fields of your lookup?&lt;BR /&gt;
in your screenshot I see date, Station_Name (as a part of Asset_name field), but I don't see Staion_id.&lt;BR /&gt;
If you have all the fields from your events, you could run something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_index
| eval DATE=strptime(DATE."%d/%m/%Y %H:%M:%S %p"), STATION_NAME=substr(ASSET_NAME,1,3)
| stats values(STATION_NAME) AS STATION_NAME max(DATE) AS DATE BY STATION_ID
| eval DATE=strftime(DATE."%d/%m/%Y)
| table STATION_ID STATION_NAME DATE
| outputlookup maintenance.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If instead you don't have (as it seems) the STATION_ID, you should create a lookup containing the relationship between STATION_ID and STATION_NAME (called e.g. stations.csv), and use it for the creation of the table:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=your_index
| eval DATE=strptime(DATE."%d/%m/%Y %H:%M:%S %p"), STATION_NAME=substr(ASSET_NAME,1,3)
| stats max(DATE) AS DATE BY STATION_NAME
| lookup stations.csv STATION_NAME OUTPUT STATION_ID
| eval DATE=strftime(DATE."%d/%m/%Y)
| table STATION_ID STATION_NAME DATE
| outputlookup maintenance.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:58:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470442#M8143</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-30T04:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470443#M8144</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=yours
| lookup  maintenance.csv STATION_NAME as LOCATION OUTPUT DATE
| where strftime(_time,"%Y/%m/%d) != DATE
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Apr 2020 08:34:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470443#M8144</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-09T08:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470444#M8145</link>
      <description>&lt;P&gt;hi thanks for the help i am able to do it but it seem there is some error below is my command:&lt;BR /&gt;
DESCRIPTION="&lt;EM&gt;sump pump&lt;/EM&gt;" OR (DESCRIPTION="&lt;EM&gt;ejector pump&lt;/EM&gt;" AND DESCRIPTION="&lt;EM&gt;run/stop&lt;/EM&gt;")&lt;BR /&gt;
| eval TIMEONLY =strptime(CREATEDATETIME ,"%d/%m/%Y %I:%M:%S %p") &lt;BR /&gt;
| eval _time=TIMEONLY &lt;BR /&gt;
| rex field=ASSET_NAME "^(?[^/]+)"&lt;BR /&gt;
| rex field=VALUE mode=sed "s/TRIP/STOP/g"&lt;BR /&gt;
| lookup  PM_DATE STATION_NAME  OUTPUT DATE&lt;BR /&gt;
| where strftime(_time,"%d/%m/%Y") != DATE&lt;BR /&gt;
| streamstats count(eval(VALUE="STOP")) AS TransactionID BY ASSET_NAME &lt;BR /&gt;
| stats range(_time) AS duration list(VALUE) AS VALUES min(_time) AS _time BY TransactionID ASSET_NAME &lt;BR /&gt;
| chart sum(duration) AS TotalActiveTime BY ASSET_NAME&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/286810-capture.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;when i take out the command "| where strftime(_time,"%d/%m/%Y") != DATE"&lt;BR /&gt;
i got these info:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/286811-capture2.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;the problem i face is that in my lookup file there is  no BCL-JLB, but during the search of my command the infomation is being filtered out, is there any idea how i can solve this issue?thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:56:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470444#M8145</guid>
      <dc:creator>chookp</dc:creator>
      <dc:date>2020-09-30T04:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470445#M8146</link>
      <description>&lt;P&gt;Hi @chookp,&lt;BR /&gt;
don't use strftime in the first part of eval, but after !=&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where DATE!=strftime(_time,"%d/%m/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;then are you sure that the fields used as key for the lookup are correct (PM_DATE)?&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 07:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470445#M8146</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-04-14T07:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470446#M8147</link>
      <description>&lt;P&gt;yes the PM_DATE is my lookup definition name&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 07:34:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470446#M8147</guid>
      <dc:creator>chookp</dc:creator>
      <dc:date>2020-04-14T07:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470447#M8148</link>
      <description>&lt;P&gt;i got the same result using | where DATE!=strftime(_time,"%d/%m/%Y"), the data is filtered away.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 07:36:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470447#M8148</guid>
      <dc:creator>chookp</dc:creator>
      <dc:date>2020-04-14T07:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470448#M8149</link>
      <description>&lt;P&gt;Hi @chookp,&lt;BR /&gt;
debug your search in this way&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DESCRIPTION="sump pump" OR (DESCRIPTION="ejector pump" AND DESCRIPTION="run/stop")
| eval TIMEONLY =strptime(CREATEDATETIME ,"%d/%m/%Y %I:%M:%S %p")
| eval _time=TIMEONLY
| rex field=ASSET_NAME "^(?[^/]+)"
| rex field=VALUE mode=sed "s/TRIP/STOP/g"
| lookup PM_DATE STATION_NAME OUTPUT DATE
| eval my_DATE=strftime(_time,"%d/%m/%Y")
| table DATE my_date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 07:41:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470448#M8149</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-04-14T07:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470449#M8150</link>
      <description>&lt;P&gt;i have the different date&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 07:51:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470449#M8150</guid>
      <dc:creator>chookp</dc:creator>
      <dc:date>2020-04-14T07:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470450#M8151</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8655i5C49A4CFCDDFC810/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 07:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470450#M8151</guid>
      <dc:creator>chookp</dc:creator>
      <dc:date>2020-04-14T07:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470451#M8152</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8656i04E8BF7BC13532E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
i add a station_name to check, there is my BCL-JLB but there is no date status is it because of this it for filtered out? as the system deem it as All time??&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 08:06:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470451#M8152</guid>
      <dc:creator>chookp</dc:creator>
      <dc:date>2020-04-14T08:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470452#M8153</link>
      <description>&lt;P&gt;use &lt;CODE&gt;| fillnull DATE&lt;/CODE&gt; before &lt;CODE&gt;where&lt;/CODE&gt;&lt;BR /&gt;
and use &lt;CODE&gt;| sort 0 _time&lt;/CODE&gt; before &lt;CODE&gt;streamstats&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 08:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470452#M8153</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-14T08:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: using lookup data to filter event</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470453#M8154</link>
      <description>&lt;P&gt;hi @chookp &lt;/P&gt;

&lt;P&gt;use this  &lt;CODE&gt;| where NOT match(DATE,strftime(_time,"%d/%m/%Y"))&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;istead of  &lt;CODE&gt;| where DATE!=strftime(_time,"%d/%m/%Y")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 11:01:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/using-lookup-data-to-filter-event/m-p/470453#M8154</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2020-04-14T11:01:22Z</dc:date>
    </item>
  </channel>
</rss>

