You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm playing around with this project for logfile parsing, and am struggling with having more than 1 parsing function, especially in more than 1 file. I'm not sure if I have something misconfigured, or if I just don't understand the underlying plugin design.
Essentially, I've created 2 files, with 2 dumb-as-can-be "parsing" functions in them. Each function prints out a simple debugging line, so we know what function is getting called.
The same does not seem to be the case with processor plugins. At least I have successfully had 2 of them in the same file, and they both seem to be called. I haven't yet tried multiple files containing processors. That's why I wondered if I was doing something wrong.
It's been a while since I worked on this, however it looks like it just uses the first parse function it finds when importing[1], unless one has been specified using the --parser CLI switch[2]. For the processors it keeps a list of all of the ones it finds and runs them all.
In this specific case, I can make it work, just by using several regex matches in an if..elif..elif..else sort of structure. In the future, I may look at patching this to handle more than 1 parser, but I'm not sure I'm up for it at the moment.
I'm playing around with this project for logfile parsing, and am struggling with having more than 1 parsing function, especially in more than 1 file. I'm not sure if I have something misconfigured, or if I just don't understand the underlying plugin design.
As an example, look at this simplified testcase
Essentially, I've created 2 files, with 2 dumb-as-can-be "parsing" functions in them. Each function prints out a simple debugging line, so we know what function is getting called.
Then I run using this syntax:
And I get this result:
If I move the "parse_tes12.py" file aside, the same syntax gives me this result:
So, I guess the question is this: Is this by design? Am I supposed to only have 1 parsing function total? Or do I have something misconfigured?
Thanks,
Lloyd
The text was updated successfully, but these errors were encountered: