Analysis property evaluating as <error>

(imported topic written by mxc0bbn)

I’ve created a property in an analysis that parses a file on a Linux computer and checks whether its hostname is in the file.

For some reason the “exists” test is not coming back with “True” or “False” but rather:

“singular expression refers to non-existent object”

The property relevance is :

exist lines whose ((preceding text of first “,” of it as string as lowercase) is equal to hostname as string as lowercase) of file ("/tmp/myfile.csv")

** I’ve also tried using “=” instead of “is equal to” **

The file is in the format (obviously with actual hostname data):

host1,Happy,No
host2,SAD,Yes
host3,Emotionless,Maybe

When I “vi” the file and add in the name of the host in a line everything works…but if the host is not there I get the error above.

Thoughts, suggestions?

Thanks.

(imported comment written by mxc0bbn)

Never mind…found the problem.

It was between my keyboard and my chair…

:slight_smile:

(imported comment written by JasonWalker)

Still helpful to post your solutions for people who find your problem in a search :slight_smile:

I’m guessing it’s something like “need to test existence of the file before looking for the existence of its content”?

if exists file “tmp/myfile.csve” then exist lines whose ((preceding text of first “,” of it as string as lowercase) is equal to hostname as string as lowercase) of file ("/tmp/myfile.csv") else false

(imported comment written by mxc0bbn)

Well the problem hence the solution was not in the syntax, but rather, as I said, a stupid mistake. the filename had an additional character that was a typo. Once fixed, everything worked.