ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Monitoring event filters (IIB10)

Post new topic  Reply to topic
 Monitoring event filters (IIB10) « View previous topic :: View next topic » 
Author Message
vladd
PostPosted: Thu Mar 25, 2021 3:57 am    Post subject: Monitoring event filters (IIB10) Reply with quote

Newbie

Joined: 25 Mar 2021
Posts: 4

I need to capture some events using monitoring feature when a certain Boolean $Environment variable is TRUE. But I can't get it to work.
Until now I've tried the following to add in Filter XPath field:

1.
Code:
$Environment/Variables/DebugLogging=true()


DebugLogging = FALSE => LOG YES
DebugLogging = TRUE => LOG YES

2.
Code:
$Environment/Variables[DebugLogging=true()]


DebugLogging = FALSE => LOG NO
DebugLogging = TRUE => LOG NO

3.
Code:
$Environment/Variables/DebugLogging


DebugLogging = FALSE => LOG NO
DebugLogging = TRUE => LOG NO

4.
Code:
$Environment/Variables/DebugLogging=TRUE


DebugLogging = FALSE => LOG NO
DebugLogging = TRUE => LOG NO

5.
Code:
$Environment/Variables/DebugLogging!=false()


DebugLogging = FALSE => LOG YES
DebugLogging = TRUE => LOG YES


6.
Code:
$Environment/Variables/DebugLogging=1


DebugLogging = FALSE => LOG NO
DebugLogging = TRUE => LOG NO

What am I doing wrong?
Back to top
View user's profile Send private message
timber
PostPosted: Fri Mar 26, 2021 6:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

See https://www.ibm.com/support/knowledgecenter/en/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ac60391_.html

The language accepted by this field is XPath, so there is no point in trying any expression that is not a valid XPath.

Are you sure that you are allowed to reference the Environment tree from this field? Have you tried referencing something in $Body to check that the filter mechanism is working?
Back to top
View user's profile Send private message
vladd
PostPosted: Fri Mar 26, 2021 9:37 am    Post subject: Reply with quote

Newbie

Joined: 25 Mar 2021
Posts: 4

timber wrote:
See

The language accepted by this field is XPath, so there is no point in trying any expression that is not a valid XPath.

Are you sure that you are allowed to reference the Environment tree from this field? Have you tried referencing something in $Body to check that the filter mechanism is working?


My first example is XPath 1.0 accepted (also simulated here freeformatter. com/xpath-tester.html#ad-output)
But your url helped a lot. It worked like this:
Code:
$Environment/Variables/DebugLogging='true'


Against all my believes and instincts but it works

Back to top
View user's profile Send private message
timber
PostPosted: Mon Mar 29, 2021 1:29 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Quote:
your url helped a lot
It's not mine. It is the IBM documentation for your task, so the first place that you should have looked!

I assume that your message flow is setting the Environment field to the string value 'true'. That explains why your XPaths did not work - they were testing for a Boolean result.
Back to top
View user's profile Send private message
vladd
PostPosted: Tue Mar 30, 2021 1:15 am    Post subject: Reply with quote

Newbie

Joined: 25 Mar 2021
Posts: 4

timber wrote:
Quote:
your url helped a lot
It's not mine. It is the IBM documentation for your task, so the first place that you should have looked!

I assume that your message flow is setting the Environment field to the string value 'true'. That explains why your XPaths did not work - they were testing for a Boolean result.

No, actually it is SET as Boolean ( the value comes from an external Boolean variable), this is why is strange for me to evaluate it against 'true'.
Back to top
View user's profile Send private message
timber
PostPosted: Tue Mar 30, 2021 3:55 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Quote:
No, actually it is SET as Boolean
Can you verify that using the output of a Trace node?
Back to top
View user's profile Send private message
vladd
PostPosted: Tue Mar 30, 2021 1:32 pm    Post subject: Reply with quote

Newbie

Joined: 25 Mar 2021
Posts: 4

Code:

2021-03-31 00:18:16.964778    83920   UserTrace   BIP2537I: Node 'monitoring_test.Compute': Executing statement   ''SET Environment.Variables.DebugLogging = DebugLogging;'' at ('.monitoring_test_Compute.Main', '5.3').
2021-03-31 00:18:16.964792    83920   UserTrace   BIP2539I: Node '{5}': Evaluating expression '{4}' at ('DebugLogging', 'FALSE'). This resolved to ''DebugLogging''. The result was ''.
2021-03-31 00:18:16.964804    83920   UserTrace   BIP2566I: Node 'monitoring_test.Compute': Assigning value       ''FALSE'' to field / variable ''Environment.Variables.DebugLogging''.


from debug i can see the variable is set as Boolean:
Code:

Environment
   Variables
         DebugLogging:BOOLEAN:false


and the actual xPath evaluations are:

Code:
2021-03-31 00:18:16.965078    83920   UserTrace   BIP4074I: The event filter on the event emitted by event source ''Log1.terminal.in'' in flow ''monitoring_test'' has been evaluated and returned 'TRUE'. The query text was ''$Environment/Variables/DebugLogging = true()''.
                                       The event filter, which controls whether an event is emitted, has been evaluated for event source ''Log1.terminal.in'' in flow ''monitoring_test''. 
                                       The result of the evaluation was 'TRUE'. 
                                       The query text evaluated was ''$Environment/Variables/DebugLogging = true()''.


and (the one that actually works):
Code:
2021-03-31 00:18:16.965258    83920   UserTrace   BIP4074I: The event filter on the event emitted by event source ''Log2.terminal.in'' in flow ''monitoring_test'' has been evaluated and returned 'FALSE'. The query text was ''$Environment/Variables/DebugLogging = 'true'''.
                                       The event filter, which controls whether an event is emitted, has been evaluated for event source ''Log2.terminal.in'' in flow ''monitoring_test''. 
                                       The result of the evaluation was 'FALSE'. 
                                       The query text evaluated was ''$Environment/Variables/DebugLogging = 'true'''.
[/code]
Back to top
View user's profile Send private message
timber
PostPosted: Tue Mar 30, 2021 1:48 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Thanks Vladd - that looks very much like a product defect to me. I think your first XPath should work.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Monitoring event filters (IIB10)
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.