Analysis required

Hi Team ,

My file output in AIX as follows .

cat /var/log/*.osbackup.log | egrep ‘WARNING|FAIL’

08/05/18-21:30:06 WARNING: SSH does not work well …checking.
08/05/18-21:30:06 WARNING: SSH did not work correctly. Re-installing keys and testing again
08/05/18-21:30:08 FAIL: SCP or SSH test failed.
08/05/18-21:30:09 WARNING: DELETING /mksysbfs file
08/05/18-21:58:27 FAIL: Logfile was not copied .
08/05/18-21:58:27 FAIL: Logfile was not copied

Basically I want to create a analysis as follows .

  1. Want to find a file under /var/log which is ending with “.osbackup.log” whether exist or not

  2. if exist , I want to search whether I have any “WARNING” message or “FAIL” message inside file .

  3. If I have , I want to display all lines ( WARNING and FAIL entries ) .

Can you some one assist here !!

I haven’t tested this, but how about something like:

lines whose (it as string contains "WARNING" OR it as string contains "FAIL") of files whose (name of it as lowercase ends with ".osbackup.log") of folders "/var/log"

Basically, the use of plural objects above will handle scenarios where things don’t exist (either the lines, or the files, or the directory/folder), and will only return data when all the conditions are met.

1 Like

Awesome. Great . It’s working as expected .