I am currently working on extracting information which I have pushed into a .dat file on Solaris OS. As per the inspector guide I am trying to grab a line with applying a filter that it starts with or starting with “xyz” but it seems to be not working for me.
For .eg.
lines whose (it starts with “Drive”) of file “storage.dat” of folder “__HardwareInfo” of client folder of site whose (name of it starts with “BES Inventory and License”)
I am using the same relevance as mentioned in “Hardware Information -Solaris” .
e.g
parenthesized part 1 of (match (regex “Platform:(.+)”) of it) of lines whose (it starts with “Platform:”) of file “general.dat” of folder “__HardwareInfo” of client folder of site whose (name of it starts with “BES Inventory and License”)
However the general.dat contains only one line.
What I am doing is that I have placed another file in “/tmp/” and this file is “test.txt” which has information like shown below:
NAME: The Zip compression library
VERSION: 11.10.0,REV=2005.01.08.01.09
VENDOR: Oracle Corporation
NAME: Solaris Zones (Root)
VERSION: 11.10.0,REV=2005.01.21.16.34
VENDOR: Oracle Corporation
NAME: Solaris Zones (Usr)
VERSION: 11.10.0,REV=2005.01.21.16.34
VENDOR: Oracle Corporation
Now if I change the relevance mentioned above to read all the lines which starts with “NAME:” and only give me the output as the part after colon.
I am getting the error as " Singular expression refers to nonexistent object."
q: parenthesized parts 1 of (matches (regex “NAME:(.+)”) of it) of lines whose (it contains “NAME:”) of file “/tmp/test.txt”
A: The Zip compression library
A: Solaris Zones (Root)
A: Solaris Zones (Usr)
There are two problems with the syntax:
Since the line is looking for something that begins with “NAME:” the only line that will display is the first one as the others have spaces before the “NAME:”. This is why I changed it to “contains”
Since there are multiple possible returns, the “parenthesized part” had to be changed to “parenthesized parts”
Now I am not sure if this is the final format you want to see, but at least it is presenting the data you want