Searching for multiple criteria in log files?

I would like a simple shell script that will allow me to display to screen all unsuccessful su attempts in my sulog file, for the present date.

I have been trying several different combinations of commands, but I can't quite get the syntax correct.

The mess I have right now (don't laugh) is this:

#!/bin/bash
DATE = `date " +%b %d"`
grep $DATE >/dev/null
if ($4 == "-"); then
printf
fi

You can see what I'm trying to accomplish here, but I'm stuck at this point. I tried reading to see if there was a way to use a complex grep or egrep command, but that was a little too complicated for me at this point.

Would someone please help me?

Thank you

Sorry, I couldn't catch your word.
Maybe explain it in detail please?

Try this :

grep "$(date +'%m/%d') ..:.. -" /var/adm/sulog

I just would like a simple script that I could use over and over that will search the sulog and print to the screen any failed attempts for whatever the date is at the present time.

I tried playing around with the find command, but I can't figure out how to combine multiple criteria.

I want to find only files without a "+" in the 4th column of the row, such as:

if \($4 == "-"\)

but having the current date in the second column.

What I was trying to do was something like:

find . -not "\+" -a -exec date '\{\}' \\; -print

but obviously doesn't work.

find doesn't work on the content of the files.
Have you tried the grep command ?

The syntax is for bash/ksh.
If your shell is sh, modify the command :
grep "`date +'%m/%d'` ..:.. -" /var/adm/sulog

Perhaps, you may have to adapt the pattern depending on the du log format.
On my system, the format of sulog is :
SU 05/16 14:03 + pts/0 sys1aud-root