Flex Token Count (ignoring tokens)
I am new to Flex connectors and have a simple question.
I need to do a log file flex connector to read my cisco call manager logs.
The call manager writes the logs to some files with the same number of tokens on each line, all the time.
The question is: Each line has 94 comma separated tokens but I just need 4 of them (ex. Token 2, 8, 48 and 60).
Do I need to declare all tokens (1 to 94) and just map the ones I am interested or i could do something like this:
If this is not write, Does anyone know other way instead of writing a regex file flex connector or declaring all the tokens?
Thanks in advance
You've got it almost right. You need to tell the connector how many tokens there are in the line and then you can pick and choose which ones you want to actually use.
Change the following line: token.count=4
Also, keep in mind numbering starts at 0, so token is actually the third field in a line.
Would it not make more sense to use a regex expression to trim out the parts your interested in and then format the tokens something along the lines of:
regex=whatever you would need here
This could be a lot more effecient memory wise since you won't be getting all 94 data elements, only the ones you want.
Thanks for the help.
I tried with this, but I need to at least declare the Token.names[1..94] or else, the smart connectors complains and i got error.
But thanks again for the help.
It was a little difficult for me to use regex, because I am new to them but as I needed a folder follower connector, I passed somedays learning and did it using regex.
Thanks for the help.
I use Regex Coach. It's free and works very well... very interactive. The regex tool within the connector is great for testing out the flex as a whole, but for just testing regex (especially when you're working on a complex string) this comes in handy.
I use the same thing, and it works wonderfully. My SOP is to design it with regex coach, then copy it over to the AS regex tool and verify it works there and add any AS specific tweaks. I also keep the Regex pocket reference handy