Example #1
0
        private void GetMatches(OSAEObjectCollection collection)
        {
            logging.AddToLog("Watching for the following Messages:", false);
            foreach (OSAEObject obj in collection)
            {
                SysLogObject sysLogObj = new SysLogObject();

                sysLogObj.TriggerString = OSAEObjectPropertyManager.GetObjectPropertyValue(obj.Name, "Trigger String").Value;
                sysLogObj.Source        = OSAEObjectPropertyManager.GetObjectPropertyValue(obj.Name, "Source IP").Value;
                sysLogObj.ExactMatch    = bool.Parse(OSAEObjectPropertyManager.GetObjectPropertyValue(obj.Name, "Exact Match").Value);
                sysLogObj.OsaObjectName = obj.Name;

                lookup.Add(sysLogObj);
                logging.AddToLog("Source IP is: " + sysLogObj.Source, false);

                if (sysLogObj.ExactMatch)
                {
                    logging.AddToLog("Message exactly matches: " + sysLogObj.TriggerString, false);
                }
                else
                {
                    logging.AddToLog("Message Contains: " + sysLogObj.TriggerString, false);
                }
            }
        }
Example #2
0
        private void GetMatches(OSAEObjectCollection collection)
        {
            logging.AddToLog("Watching for the following Messages:", false);
            foreach (OSAEObject obj in collection)
            {
                SysLogObject sysLogObj = new SysLogObject();

                sysLogObj.TriggerString = OSAEObjectPropertyManager.GetObjectPropertyValue(obj.Name, "Trigger String").Value;
                sysLogObj.Source = OSAEObjectPropertyManager.GetObjectPropertyValue(obj.Name, "Source IP").Value;
                sysLogObj.ExactMatch = bool.Parse(OSAEObjectPropertyManager.GetObjectPropertyValue(obj.Name, "Exact Match").Value);
                sysLogObj.OsaObjectName = obj.Name;

                lookup.Add(sysLogObj);
                logging.AddToLog("Source IP is: " + sysLogObj.Source , false);

                if (sysLogObj.ExactMatch)
                {
                    logging.AddToLog("Message exactly matches: " + sysLogObj.TriggerString, false);
                }
                else
                {
                    logging.AddToLog("Message Contains: " + sysLogObj.TriggerString, false);
                }
            }
        }