Search in TXT log file for a piece of text

I have a .txt logfile and want to search in the file for a piece of text.
If the text is in the file i like a true output and not a false output

i found and tried this flow but always displays false... does anyone know what's wrong?

https://flows.nodered.org/flow/1e5f25206fadb339293e879f397fa513

Please take note of the pinned message and put your code between triple back-ticks. As it is, it is unusable. Thanks.

As I think you are using a function node to do the search (?), it may be easier just to show that code separately.

i'm sorry, i changed my massage and put the url in it..


image

image

Can you post the logfile somewhere (or post some example lines) and the string you are trying to find ?

To check if element exists in array use
yourArray.indexOf(element) != -1

What you are doing currently is the check if the entry is in array and is not first element of that array

why not use a switch node?

sometimes it is too simple for words and I think too difficult ... thank you ! it works..

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