Highlighted
Honored Contributor.. HPMST Honored Contributor..
Honored Contributor..
93 views

regular expression issue in linux

Dear ALL,

I am trying to Monitor log file in linux machine. I want to match for certain words example below 

1- locations-processed.geofence.dlq       100      ----> i don't want this log entry 

2- locations-processed.geofence   100                  ------> I want this entry only 

I want to check the number more  than 10 

 

I try below 

<*>locations-processed.geofence   <<#.count> -gt 10><*>

but unfortunate this expression work only if entry 2 before entry 1 other than this it is not matched so I want to match for entry 2 exact words and neglect entry 1 

 

is there anyidea 

 

 

0 Likes
4 Replies
Honored Contributor.. HPMST Honored Contributor..
Honored Contributor..

Re: regular expression issue in linux

I try the same expression in Windoes and it work fine but the issue in linux only 

0 Likes
Honored Contributor.. HPMST Honored Contributor..
Honored Contributor..

Re: regular expression issue in linux (URGENT please)

Dear Microfocus experts,

Is there any idea please kindly support  I want to match for below only 

 locations-processed.geofence   100

and not match for below 

 locations-processed.geofence.dlq       100 

 

Thanks all

 

0 Likes
Outstanding Contributor.. andreask Outstanding Contributor..
Outstanding Contributor..

Re: regular expression issue in linux

May be the whitespace character has an issue. so try this

<*>locations-processed.geofence<_><<#.count> -gt 100><*>

enable local logging in the policy and check if the lines matches.

ussually i dont like to use -gt in logfile polices as in former times this caused me a lot of trouble.

An alternative is to use a structured metric logfile policy (use Agent 12.11 or 12.04 or get hotfixes) and use this olicy to write the numbers into CODA. then use a tresold policy to create a message when >100

 

also there are  issues with Agent versions12.05 and 12.06 and also 12.10. so try with 12.11 or ask MF Support for hotfixes for your agent version and try with them again.

Good Luck

 

 

0 Likes
Respected Contributor.. hiteshkumar Respected Contributor..
Respected Contributor..

Re: regular expression issue in linux

Hello,

 

Just try below if it will helpful.

<*>locations-processed.geofence<_><<#.count> -gt 10><*>

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.