I have been trying to build an analysis to collect the NTP server and peer systems for my Linux environment, both NTP and Chrony
I was able to hobble together a query from another post but would like some help to cleanup the output to just be the server name or ip, and not the entire line.
lines whose ((it as lowercase contains "server" or it as lowercase contains "peer") and it as string does not start with "#") of files ("/etc/inet/ntp.conf";"/etc/ntp.conf";"/etc/chrony.conf") whose (exists line whose ((it as lowercase contains "server" or it as lowercase contains "peer") and it as string does not start with "#") of it)
preceding text of first " " of following text of first " " of lines whose ((it as lowercase contains "server" or it as lowercase contains "peer") and it as string does not start with "#") of files ("/etc/inet/ntp.conf";"/etc/ntp.conf";"/etc/chrony.conf") whose (exists line whose ((it as lowercase contains "server" or it as lowercase contains "peer") and it as string does not start with "#") of it)
Very close but get an error as there are multiple returns and after the first answer it gives an error and doesnt report the other server/peer entries for a given system:
preceding texts of first " " of following texts of first " " of lines whose ((it as lowercase contains "server" or it as lowercase contains "peer") and it as string does not start with "#") of files ("/etc/inet/ntp.conf";"/etc/ntp.conf";"/etc/chrony.conf") whose (exists line whose ((it as lowercase contains "server" or it as lowercase contains "peer") and it as string does not start with "#") of it)