Relevance error

Hi,

I am trying to run below relevance but giving me error A singular expression is required. Kindly help

(“Paths:” & concatenations “&” of (“/var/” & it & “/.ssh/authorized_keys”) whose (exists file (“/var/” & it & “/.ssh/authorized_keys”)) of (names of users whose (name of it as lowercase starts with “dummyuser” as lowercase)))
& “&Contents:” & concatenations “&” of (lines of files (“/var/” & it & “/.ssh/authorized_keys”)) whose (exists file (“/var/” & it & “/.ssh/authorized_keys”)) of (names of users whose (name of it as lowercase starts with “dummyuser” as lowercase)))

I found two issues, try & test following:

("Paths:" & concatenation "&" of ("/var/" & it & "/.ssh/authorized_keys") whose (exists file ("/var/" & it & "/.ssh/authorized_keys")) of (names of users whose (name of it as lowercase starts with "dummyuser" as lowercase))) & "&Contents:" & concatenation "&" of (lines of files ("/var/" & it & "/.ssh/authorized_keys")) whose (exists file ("/var/" & it & "/.ssh/authorized_keys")) of (names of users whose (name of it as lowercase starts with "dummyuser" as lowercase))

1 Like

Hi @vk.khurava

Thanks for the help, I tried the suggested relevance but still getting the same error “A singular expression is required”

I don’t have the exact same setup, but I tried to replicate the problem as closely as possible to identify the issue. Based on my analysis, it seems the combination of files, their lines, or specific user configurations might not be aligning with the query requirements in your setup.

Here’s what I was able to create and test based on the setup I built. In my case, the names of users relevance did not resolve correctly, so I referred to a different approach using /etc/passwd for user data:

Q: ("Paths:" & concatenation "&" of ("/home/" & it & "/.ssh/authorized_keys") whose (exists file it) of unique values of (preceding text of first ":" of it) of lines whose (it contains "/home/dummyuser") of file "/etc/passwd") &  " &Contents:" & concatenation "&" of (lines of file it) of ("/home/" & it & "/.ssh/authorized_keys") whose (exists file it) of unique values of (preceding text of first ":" of it) of lines whose (it contains "/home/dummyuser") of file "/etc/passwd"
A: Paths:/home/dummyuser1/.ssh/authorized_keys&/home/dummyuser2/.ssh/authorized_keys&/home/dummyuser3/.ssh/authorized_keys&/home/dummyuser4/.ssh/authorized_keys&/home/dummyuser5/.ssh/authorized_keys &Contents:ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArandomkeycontent_1&ssh-rsa AAAAB3...dummyuser1_key&ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArandomkeycontent_2&ssh-rsa AAAAB3...dummyuser2_key&ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArandomkeycontent_3&ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArandomkeycontent_4&ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArandomkeycontent_5
T: 2376

This query worked as expected in my setup and resolved the paths and contents successfully.