Why does grep not return the from line?

Mikmikmikmik

New Member
Joined
Nov 23, 2018
Messages
9
Reaction score
1
Credits
72
I have this but grep is not returning the from line. It is something to do with the relay= part of the line.
If I modify it to say relay=exampleXXX111.examplf.ex.examplf.com, it outputs the line just fine.

There are other ways to get this info, but I would like an explanation for this specific example.
Thanks.


echo "Apr 4 05:00:24 example sendmail[3365]: x3440OxC003366: from=<[email protected]>, size=10181, class=0, nrcpts=1, msgid=<[email protected]>, proto=SMTP, daemon=MTA, relay=exampleXXX111.examplf.ex.example.com [10.100.10.10]" | grep -v "to=.*\.example\.com"

NO OUTPUT


echo "Apr 4 05:00:24 example sendmail[3365]: x3440OxC003366: from=<[email protected]>, size=10181, class=0, nrcpts=1, msgid=<[email protected]>, proto=SMTP, daemon=MTA, relay=exampleXXX112.examplf.ex.examplf.com [10.100.10.10]" | grep -v "to=.*\.example\.com"

OUTPUT:
Apr 4 05:00:24 example sendmail[3365]: x3440OxC003366: from=<[email protected]>, size=10181, class=0, nrcpts=1, msgid=<[email protected]>, proto=SMTP, daemon=MTA, relay=exampleXXX112.examplf.ex.examplf.com [10.100.10.10]


Thanks.
 


G'day @Mikmikmikmik - I am moving this to Command Line, where it may attract more qualified input.

Good luck

Chris Turner
wizardfromoz
 
Not sure if this is just a typo or not, but you have two different search strings.

exampleXXX111.examplf.ex.example.com ...and ...

exampleXXX112.examplf.ex.examplf.com .

Is it supposed to example.com or examplf.com ?
 

Members online


Latest posts

Top