Simon icon Simon
Flexible server monitoring

Unable to filter for HTML

I am trying to filter a web page containing the following source:

<tr>
<td><a href="browse.jsp?JMSDestination=DEVREP.TOROUTE">


DEVREP.TOROUTE</a></td>
<td>1</td>
<td>2</td>
<td>30754</td>
<td>31505</td>
<td>
    <a href="browse.jsp?JMSDestination=DEVREP.TOROUTE">Browse</a>
<a href="queueConsumers.jsp?JMSDestination=DEVREP.TOROUTE">Active Consumers</a><br/>
    <a href="queueBrowse/DEVREP.TOROUTE?view=rss&feedType=atom_1.0" title="Atom 1.0"><img src="images/feed_atom.png"/></a>
    <a href="queueBrowse/DEVREP.TOROUTE?view=rss&feedType=rss_2.0" title="RSS 2.0"><img src="images/feed_rss.png"/></a>
</td>
<td>
    <a href="send.jsp?JMSDestination=DEVREP.TOROUTE&JMSDestinationType=queue">Send To</a>
    <a href="purgeDestination.action?JMSDestination=DEVREP.TOROUTE&JMSDestinationType=queue">Purge</a>
    <a href="deleteDestination.action?JMSDestination=DEVREP.TOROUTE&JMSDestinationType=queue">Delete</a>
</td>
</tr>

I want to filter for the first number in the field after the DEVREP.TOROUTE section to determine if it is in a range.

Any help is appreciated.

Thanks

David Sinclair's picture

Re: Unable to filter for HTML

So you want to look for the number in <td>1</td>?

That's easy to do. What you'd want is two filters: a Block filter to narrow down the output to that number, then a Number Out of Range (or similar) filter to evaluate the number.

For the Block filter, specify enough context to find the desired text. In this case, something like this would work for Start:

DEVREP.TOROUTE</a></td>
<td>

And simply this for End:

</td>

That will narrow down the output to just the "1" value, which can be evaluated with a Number-based filter as desired.

Re: Unable to filter for HTML

When I look at the source of the page:

<tr>
<td><a href="browse.jsp?JMSDestination=DEVREP.TOROUTE">


DEVREP.TOROUTE</a></td>
<td>1</td>
<td>2</td>
<td>32941</td>
<td>33692</td>
<td>
    <a href="browse.jsp?JMSDestination=DEVREP.TOROUTE">Browse</a>
<a href="queueConsumers.jsp?JMSDestination=DEVREP.TOROUTE">Active Consumers</a><br/>
    <a href="queueBrowse/DEVREP.TOROUTE?view=rss&feedType=atom_1.0" title="Atom 1.0"><img src="images/feed_atom.png"/></a>
    <a href="queueBrowse/DEVREP.TOROUTE?view=rss&feedType=rss_2.0" title="RSS 2.0"><img src="images/feed_rss.png"/></a>
</td>
<td>
    <a href="send.jsp?JMSDestination=DEVREP.TOROUTE&JMSDestinationType=queue">Send To</a>
    <a href="purgeDestination.action?JMSDestination=DEVREP.TOROUTE&JMSDestinationType=queue">Purge</a>
    <a href="deleteDestination.action?JMSDestination=DEVREP.TOROUTE&JMSDestinationType=queue">Delete</a>
</td>
</tr>

I have a filter set for

ANY, Block Response Text
Start:

DEVREP.TOROUTE</a></td>
<td>

END:

</td>

ANY, Number out of range output text
If input is fixed value of 0

And this always passes? Not sure why given the HTML source above.

Thanks

Greg

David Sinclair's picture

Re: Unable to filter for HTML

By the way, if you're going to paste HTML here, please wrap it in <code> tags, to ensure it is displayed properly. (I've edited your post and comment for you.)

The Number Out of Range filter actually looks for the previous value plus or minus 5.

You might want to add a custom Number-based filter, to do "input is not fixed value of zero". Also make sure it's not looking for changes, to result in a failure instead of a change if not zero.

Re: Unable to filter for HTML

I changed the number changed filter to be Input is not fixed value of 1 and the test still will not pass.

Filter is set to number is not fixed value of 1. Do I need anything in Ignore?

Filter says ResultL Failure is above condition is true.

Source code on web site shows it to be 1. Same as above.

On test: Set as above. start DEV.TOROUTE</a></td><td>
End </td>

Any, Number not 0 Output Test
Success if input is not fixed value of 1.

Is there any sort of log to help debug this?

Thanks

Greg

David Sinclair's picture

Re: Unable to filter for HTML

You can use the Activity log to see what each filter outputs. That should make it clear what is going on.

If that doesn't help, perhaps you could email me screenshots of your filter setup.

Re: Unable to filter for HTML

How would I filter for the 3rd number in the list?

Thanks

Greg

David Sinclair's picture

Re: Unable to filter for HTML

You could use a Block filter to narrow down the output, e.g. by looking for the 3rd occurrence of the Start text:

</td>
<td>

Remember to paste as-is. And note that you can do the "3rd occurrence" part via the advanced options hidden off to the right — drag the dot to the left to expose them.

That might be all you need, or you could use another filter after that to analyze further.

David Sinclair's picture

Re: Unable to filter for HTML

I have fixed the issue where the Number filter always looked for changes, instead of resulting in a failure. This fix is in version 3.2, due out soon.