LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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


greets~

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):

Code:
49 708.208165  10.0.0.1 -> 10.0.0.2  DNS Standard query MX gmail.com
...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!
~k

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

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


Reply


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 08:41 AM
Help with regular expression Feyd-Rautha Programming 8 04-21-2008 12:18 PM
sendmail.cf , filter by subject using regular expression? linuxlah Linux - Software 0 01-31-2004 12:01 AM
Anyone know regular expression? ahhua Linux - Software 1 12-04-2003 09:13 AM
regular expression gumby Programming 3 07-15-2003 01:13 PM


All times are GMT -5. The time now is 04:21 PM.

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