0
votes

I am new to Drools Fusion, I am unable to create a rule for below condition

  1. Read the server log file with (Date, Error message etc...)
  2. If found Event Type: ERROR with Event Message: "Memory Error" have to trigger some event (as of now SOP)
  3. Another (with in) 1hr it should not trigger event for same Event Message & Event Type (if its found in log file)
  4. After 1hr if it found the same, it has to trigger event

Note: Have to use same date & time specified in log file

Please do the needful for the same.

1

1 Answers

0
votes

I'm not sure exactly what you're looking for. I'll respond conceptually. I'm going to assume you are trying to do everything within the drools framework.

  1. For drools to be constantly aware of the server log you will need to be running a stateful knowledge session and constantly inserting new facts into it. These facts would be derived from the server log.

  2. It looks like you want to talk about Events in your model. Make an Event class. For this example, the class should probably have "type" and "message" fields. Presumably you would insert new event objects using code which is constantly getting information from the server log (either reading a file, through REST, or whatever).

  3. In order to do time based logic you can use cron expressions. You can also use Calendar in more recent versions of drools. This is a brief example of doing it with cron.