Query Database Based on Previous Timestamp
One of our developers has been working on an eventsource that queries an oracle database and alerts when certain log messages are found in a particular table. This eventsource is set to run once an hour and not wanting to get duplicate records, she's gone the route of checking that the timestamp of the returned results are greater than (now - 70 minutes). This has been working OK, but it's not perfect and it feels a little hacky. Ideally we could somehow save the latest timestamp or rowid/rownum and use that for the next run.
One idea was to set a property, using the LM rests api, on the device this eventsource is applied to, which I think would honestly work out quite well, but it also feels like more work than should be required.
So I'm asking the community, has anyone else been in this situation, and if so, how were you able to handle it?
Thanks
- Anonymous4 years agoOn 2/12/2021 at 10:15 AM, Josh Jacques said:
One idea was to set a property, using the LM rests api, on the device this eventsource is applied to, which I think would honestly work out quite well, but it also feels like more work than should be required.
This is how i'd do it. Theoretically, you could also use script caching.