Setting relevance to look for value in created file

This may be a dumb question but I currently have a fixlet that is reading the database on a linux machine and outputting to a file a users operator code and how many failed logins they have. I am trying to set relevance based on if that failed login amount is greater than or equal to 6 and I keep getting not relevant triggers when the file I have proven is out on the machine.

Here is the layout of the text file

OPERATORCODE FAILED_LOGONS
### 6

My relevance is looking for the following

line 2 of file “/tmp/locked.txt” >= “6”
exists file “/tmp/locked.txt”

Am I just missing something really simple here or can I somehow tell the relevance to look in the column of FAILED_LOGONS?

@AQuebman

Thanks for showing your work so far. Really helps in getting you answers!

try:

exists file "/tmp/locked.txt"  whose (following text of last " " of line 2 of it as integer >= 6)
1 Like

Thanks for your help Brolly. Apologies for the delayed response due to the holiday, let me try out your suggestion and see how that works out for the issue I am having.

So the whose line on the relevance is causing my test computer that I confirmed has this file and the data listed above to no longer become relevant. It is relevant if I just look for the existance of the file so it at least recognizes the file is there so I think the whose line is the problem spot.

Does the following test of last " " capture that first value as this operator code value is going to change many times over the life of this fixlet?

Ill note that the end goal of this exercise is to grab any number of operatorcodes with 6 or more failed logins and then run a process to unlock them so the test only has one but it could have 50 and id want to be able to handle all of them.

There might be some whitespace involvement here.
Let’s try this alternative

exists file "/tmp/locked.txt"  whose (exists line whose (it starts with "###" and exists following text whose (it as trimmed string as integer >= 6) of first "###" of it) of it)