Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-15-2009, 02:24 PM   #1
LQ Newbie
Registered: Feb 2006
Location: 010101010101001101000001
Distribution: slackware
Posts: 7

Rep: Reputation: 0
Question tshark regular expression to filter for MX requests?


any regex wiz out there willing to throw me a regular expression that can be used with tshark (or tcpdump or ngrep for that matter) which would filter results and show only DNS MX requests? A standard regular expression would work in any of the aforementioned tools... if I could actually write it correctly.

For the record, in tshark the request would look like this (well, specifically for gmail request anyway):

49 708.208165 ->  DNS Standard query MX
...and i was trying to write an expression that looked for "MX", case-sensitive (since it will always be upper-case).

I'm going around in circles with this and could really just use a helping hand.
thanks for the interest...peace!

Last edited by kr0m3; 04-16-2009 at 06:07 AM.
Old 04-16-2009, 06:51 AM   #2
Senior Member
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
awk '$(NF-1)=="MX"{print $NF}' file


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
regular expression Ammad Linux - General 5 08-01-2008 07:41 AM
Help with regular expression Feyd-Rautha Programming 8 04-21-2008 11:18 AM , filter by subject using regular expression? linuxlah Linux - Software 0 01-30-2004 11:01 PM
Anyone know regular expression? ahhua Linux - Software 1 12-04-2003 08:13 AM
regular expression gumby Programming 3 07-15-2003 12:13 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:17 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration