Logstash Custom Patterns is not not working

I have defined the following grok filter :

filter{
if[message] !~ ".*sub-page-type=[-a-zA-Z0-9_]+"
{
drop{}
}
else
{
patterns_dir => ["{env path}/patternCustom"]
match =>{
"message" => ".*StartTime=%{NUMBER:StartTime}.*MarketplaceId=%{MARKETPLACE_ID:MarketplaceId}.*Session=%{SESSION:Session}.*CustomerId=%{CUSTOMER_ID:CustomerId}.*StatusCode=%{NUMBER:StatusCode}.*sub-page-type=%{SUB_PAGE_TYPE:SubPageType}"
}
}
}
}

and the custom pattern file is as follows

MARKETPLACE_ID [0-9A-Za-z]*
SESSION [0-9-]*
CUSTOMER_ID [0-9A-Za-z]+
SUB_PAGE_TYPE [-a-zA-Z0-9_]+

I'm not able to find the error in this , because in the logstash.log im getting pattern not defined error.

any help would be appreciated.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.