equal
deleted
inserted
replaced
66 irk, target = pvl.irker.apply(options, target=target) |
66 irk, target = pvl.irker.apply(options, target=target) |
67 |
67 |
68 |
68 |
69 log.info("Process syslog messages...") |
69 log.info("Process syslog messages...") |
70 for item in syslog.main() : |
70 for item in syslog.main() : |
71 item = rules.apply(item) |
71 match = rules.apply(item) |
72 |
72 |
73 if not item : |
73 log.info("%s: %s", item, match) |
|
74 |
|
75 if not match : |
74 continue |
76 continue |
|
77 |
|
78 rule = str(match.get('rule')) |
75 |
79 |
76 log.info("%s", item) |
80 out = { rule: match.get(rule) } |
77 |
81 |
78 rule = item.get('rule') |
82 for tag, message in out.iteritems() : |
79 |
83 # TODO: map tag -> target? |
80 if rule : |
84 if target : |
81 out = item.get(str(rule)) |
85 target(message) |
82 else : |
86 else : |
83 out = None |
87 print tag, message |
84 |
|
85 if not out : |
|
86 continue |
|
87 |
|
88 # TODO: map tag -> target? |
|
89 if target : |
|
90 target(out) |
|
91 else : |
|
92 print rule, out |
|
93 |
88 |
94 # done |
89 # done |
95 log.info("Exiting...") |
90 log.info("Exiting...") |
96 return 0 |
91 return 0 |
97 |
92 |