How to extract a word from a file for comparison

(imported topic written by SystemAdmin)

Q: (following text of first "Type : " of preceding text of last “MainMode” of lines containing “Type” of it) of file “/tmp/mojo”

E: Singular expression refers to nonexistent object.

I would like to assign the resulting valuie to a variable if possible

Actual file I’m trying to extract the lab

======================================================================

Hostname : uxlab020 Status : active

Type : lab MaintMode : NO

Console : VM VIC SNI Tag :

OS Vendor : oel

Location : cbc Rack : telcom

Model : unknown BkupDay : SAT

Serial : vmware SHAMU Menu : Y

Function : quest Class : application

Qrel : Planning :

Description

SOA

Notes

Changed purpose from Quest Lab - Shared Web Server #2 on Mon 01-24-08 to Quest

Lab - Data Profiling for Troy Marrick

(imported comment written by JackCoates91)

Typo: should be “MaintMode” instead of “MainMode”.

(imported comment written by SystemAdmin)

Thanks, that now works.

Q: (following text of first "Type : " of preceding text of last “MaintMode” of lines containing “Type” of it) of file “/tmp/mojo”

A: lab

T: 732

But to take it a step further, how can I run a utility that generates the output without creating and then reading a static file.

Better yet, in my Bigfix Enterprise Console, Computers , there’s a column heading “environment” that already has this result, but where is that coming from???

(imported comment written by JackCoates91)

Sounds like someone else already tagged the devices?

Running a command and evaluating results are intentionally separate actions in BigFix, there isn’t a way to run the command and pipe it straight into a BigFix returned value. However, if you can get at the information through the registry, WMI, or DMI, you can bypass the output to file step.

(imported comment written by SystemAdmin)

No registery… Need this for Unix/Linux (AIX, Solaris, Linux(rhel,oel,sles)

(imported comment written by JackCoates91)

Hi,

then your best bet is to stick with a file which you can use a recurring action to prepare, then read via a custom property or an analysis.

I’d look into how it’s already appearing in your interface, first, seems like the work might already be done.