Monday, March 10, 2008

SCEProlog - Prolog for the State Based Correlation Engine

A new release of OpenESM for Prolog (V1.1) is now available at Sourceforge. This new release includes a Prolog engine for the TEC 3.9 State Based Correlation Engine (SCE).

You can download the new release at:

http://sourceforge.net/projects/gulfsoft

Here are some notes from the Readme:

SCEProlog - Prolog for the State Based Correlation Engine

This library implements a Prolog environment as a State Based Correlation Engine custom action. Why would you want to use Prolog at the TEC Gateway or adapter level? Firstly, a Prolog environment would allow you to leverage most of your existing Prolog facts and logic that enrich events before true event correlation. Secondly, the Prolog language provides a flexible and powerful language to manipulate event objects. Finally, since Prolog is the base language for the TEC rule language, it is familiar to every seasoned TEC rule writers.

The underlying Prolog implementation for SCEProlog is GNU Prolog for Java (http://gnuprologjava.sourceforge.net/) by Constantine A. Plotnikov. While this project seems stagnant, I found it the simplest to integrate with the State Based Correlation Engine. Included with this distribution is the gnuprolog.jar file. If you desire to see the source of the GNU Prolog for Java library it is available for download from the original project website.

The SCEProlog environment implements the most of the ISO standard with the following additional predicates:

BIM Prolog compatability:
lowertoupper(LowerAtom,UpperAtom)
inttoatom(Integer,Atom)
realtoatom(Real,Atom)
atomconcat(Atom1,Atom2,Concat)
atomconcat(AtomList,Concat)
append(List1,List2,ApendedList)
member(Element,List)
memberchk(Element,List)
erase(Key)
erase(Key1,Key2)
record(Key,Term)
record(Key1,Key2,Term)
recorded(Key,Term)
recorded(Key1,Key2,Term)
rerecord(Key,Term)
rerecord(Key1,Key2,Term)

State based Correlation Engine:
set_event_class(ClassName)
get_event_class(ClassName)
set_event_slot(SlotName,SlotValue)
get_event_slot(SlotName,SlotValue)
get_event_slot(SlotName,SlotValue,DefualtValueIfNotSet)
delete_event_slots(SlotNameList)
discard_event
forward_event(SCE_RuleName_List)
get_rule_id(SCE_RuleId)
get_rule_variable(SCE_VariableName,VariabeValue)

IP Address Name Resolution:
get_hostname(IPAddress_or_Name,Hostname)
get_ipaddress(Hostname,IPAddress)
get_local_hostname(LocalHostname)
get_local_ipaddress(LocalIPAddress)
get_canonical_hostname(IPAddress_or_Name,CanonicalHostname)

Regular Expressions:
regex_create(RegexID,Pattern)
regex_create(RegexID,Pattern,RegexFlagList)
valid RegexFlag values:
canon_eq,
case_insensitive,
comments,
dotall,
multiline,
unicode_case,
unix_lines
regex_exists(RegexID)
regex_match(RegexID,Atom)
regex_match(RegexID,Atom,GroupMatchList)
regex_replace(RegexID,Atom,Replacement,Result)

Misc. Utilities:
get_system_property(JavaSystemProperty,PropertyValue)

You can see the rest of the notes in the readme that is part of the gb_08MAR2006.zip file.

No comments: