Hello,
I have a simple GeoEvent process where I want to log data when my filter is true. My issues it that I only want to log this data one time and it comes in multiple times.
Is there a way to track if something has been captured already and throw away the rest?
i.e. I have a filter where Name = John, When this is true I log it, but if John comes in again I want to throw it away.
Any ideas on how to achieve this?
Drew
Hello Drew --
What you want to do is not possible using only a Filter and Output when writing data out to a JSON or CSV (delimited text) file. Event records received and adapted by an input should be considered atomic. In other words, a GeoEvent Service (generally) doesn't cache or retain any information about event records previously processed. You cannot compare one event record to another, so there is no way to determine that an event record whose attribute Name matches 'John' is similar to another event record -- at least not using a Filter.
The Event Volume Controller processor does cache data in order to emit only one one record matching some filterable criteria every "so many seconds". This doesn't do exactly what you want -- to emit exactly one event record and discard all duplicates. I mention it only to highlight that you need something that caches and holds event records in order to compare one to another.
I think what you probably want to do is use data from event records being processed to update a feature record, via a feature service, in a geodatabase. You can choose to update just the feature record's date/time attribute, using the attribute field Name as the TRACK_ID to determine which "user" feature record to update. I would probably choose to record the date/time the data was last observed and the feature record updated. You can then script a query to pull data from the feature service and create the "logged once only" list of data records with specific user names.
However, since GeoEvent Server (generally) receives, adapts, and processes every data record independently, every data record matching a Filter you configure will be routed through whatever workflow your GeoEvent Service is configured to perform and direct all processed event records to an Output. If that output writes data to a system file, every data record with a Name matching 'John' will be written to the file. If that output updates a database record, every data record with a Name matching 'John' will be used to update a record in the database.
Hope this information helps --
RJ
Thank you very much for the detailed response @RJSunderman .
It has given me some ideas to achieve this.
Hope you have a happy new year.
Drew