I have a UserParameter to define logs locations and the regex expressions to identify the row in the item and then have trigger expression. Looks like this:
{
"data": [
** * * * * {"{#LOG}":"/tmp/poc/logs/poc_process_1.log","{#MATCH_REGEX}":"error","{#ERR _MSG}":"This is abc issue","{#ERR_REGEX}":"error|problem","{#ENCODING} ":"","{#MAXLINES}":"1","{#MODE}":"","{#OUTPUT}":"" ,"{#MAXDELAY}":""}
]
}
The item data comes in fine and I can see it using monitoring-->latest data.
When I use this expression with hardcoded regexp parameter, I am able to have the problem raised.
{t_task_app_log:log[{#LOG},{#MATCH_REGEX},{#ENCODING},{#MAXLINES},{#MO DE},{#OUTPUT},{#MAXDELAY}].regexp("error|problem")}=1
However, when I use the LLD variable within the expression, it never works. I tried with and without double quotes. I tried the str function and it too has the same issue.
{t_task_app_log:log[{#LOG},{#MATCH_REGEX},{#ENCODING},{#MAXLINES},{#MO DE},{#OUTPUT},{#MAXDELAY}].str("{#ERR_REGEX}")}=1
Just to be sure, I put the {#ERR_REGEX} in the trigger title, and I can see the right value within the trigger title on the configuration-->host-->item page...so I know all these #values are coming in ok.
Any suggestions on how to triage...or what might be off in expression?
{
"data": [
** * * * * {"{#LOG}":"/tmp/poc/logs/poc_process_1.log","{#MATCH_REGEX}":"error","{#ERR _MSG}":"This is abc issue","{#ERR_REGEX}":"error|problem","{#ENCODING} ":"","{#MAXLINES}":"1","{#MODE}":"","{#OUTPUT}":"" ,"{#MAXDELAY}":""}
]
}
The item data comes in fine and I can see it using monitoring-->latest data.
When I use this expression with hardcoded regexp parameter, I am able to have the problem raised.
{t_task_app_log:log[{#LOG},{#MATCH_REGEX},{#ENCODING},{#MAXLINES},{#MO DE},{#OUTPUT},{#MAXDELAY}].regexp("error|problem")}=1
However, when I use the LLD variable within the expression, it never works. I tried with and without double quotes. I tried the str function and it too has the same issue.
{t_task_app_log:log[{#LOG},{#MATCH_REGEX},{#ENCODING},{#MAXLINES},{#MO DE},{#OUTPUT},{#MAXDELAY}].str("{#ERR_REGEX}")}=1
Just to be sure, I put the {#ERR_REGEX} in the trigger title, and I can see the right value within the trigger title on the configuration-->host-->item page...so I know all these #values are coming in ok.
Any suggestions on how to triage...or what might be off in expression?
Comment