Read words from line into different properties

(imported topic written by Trailsuender)

I have a file on several computers a file containing exactly one line with this content (example):

wlibe000486 Windows 123

How do I read by use of an Analysis each of the word into properties like

my_computer_name -> should contain “wlibe000486”

my_computer_os -> containing “Windows”

my_days_since_password_change -> containing “123”

I really appreciate any help solving this beginners question.

(imported comment written by sinucus)

Why not just use the built in anaylses?

q: hostname, operating system, (name of it) of logged on user, password age of user (name of logged on user)

A: computername, Win7 6.1.7601, username, ( 26 days, 21:24:27 )

(imported comment written by Trailsuender)

Thanks for reply and sorry for asking silly questions, but I’m absolute beginner.

[arri@sulibeomst30 tmp]
$ qna
Q: hostname, operating system, (name of it) of logged on user, password age of user (name of logged on user)
E: The operator “password age” is not defined.

What is wrong?

(imported comment written by sinucus)

Seeing as your command started with “$ qna” I’m assuming that this is a *nix OS. The inspector I was quoting above are Windows inspectors and thus would not work on linux.

They only have a few properties for user inspectors on Linux, so you’ll need to fallback to your original question. Is there any formatting to the file that you are creating? Are the values seperated by 10 spaces? a comma? It would be possible to do regex extraction via Tivoli.

(imported comment written by Trailsuender)

I can write into the file what I want to, e.g.

0123,Linux,myserver

where

  • 0123 are the days of last password change (including trailing zero)
  • Linux, AIX, Solaris or SunOS is the name of the OS
  • myserver is the hostname

I want to fill 3 different properties in an Analysis, making it possible to sort by age, OS and hostname.

I have absolutely no clue how to read it from the file using relevance language and let the results separated by comma into different properties.

(imported comment written by sinucus)

OK, so you need 3 columns then… Which means that you’ll need 1 analysis with 3 properties. Each property will be one component of the file. You know how many components are in this file as you are creating it.

So, you’ll need this line 3 times.

You’ll name each property based on it’s header, i.e. hostname/username/password age

tuple string item 0 of (concatenation ", " of substrings separated by “,” of line 1 of file “test.txt”)

tuple string item 1 of (concatenation ", " of substrings separated by “,” of line 1 of file “test.txt”)

tuple string item 2 of (concatenation ", " of substrings separated by “,” of line 1 of file “test.txt”)

(imported comment written by Trailsuender)

1000 thanks, your are my relevance script hero. How can I pay you a beer? :wink:

(imported comment written by Trailsuender)

Last question:

Because I assume you are an expert, please can you suggest a link, where I can download a complete relevance language compendium (as pdf)? It may of course also contain as many examples as possible.

For your reply many thanks in advance

(imported comment written by Trailsuender)

FYC, “password age…” does also not work on my TEM server 8.2.1409.0, what is a Windows server:

Q: ( name of it ) of logged on user

A: urri

T: 0.733 ms

Q: password age of user ( name of logged on user )

E: Singular expression refers to nonexistent object.