Microsoft
Software
Hardware
Network
Question : Perform wildcard search in log files
I have a ton of email log files that are currently in .txt format. I want to search for a text string using a wildcard expression. It looks like the default search tool that comes with Windows does not let you search inside of files with wildcard expressions. If I change the file extension to .csv and then perform a FIND while inside the file, the search appears to works just fine. However, I don't want to have to open up every file to perform the search. I would like to scan the entire directory where the log files reside and find out which log files contain the search string. Is there another tool that can help me accomplish this. My search term would be something similar to this:
RCPT To:<*@domain.com
....where there could be an number of characters in place of the asterik.
Answer : Perform wildcard search in log files
Use the findstr comamnd line tool:
findstr /I /R /M "RCPT To:
[email protected]
" *.txt
It will search all *.txt files for the string and just list the matching file names.The "." right before the @ is the wildcard character.
HTH
Random Solutions
Exchange 2007 Information store & system attendant won't start automatically
Creating an ODBC connection via VBA utilizing a generic username and password
Folder Contents
Recipe Database
DNSCMD file on your server
Table structure for tracking an annual budget with monthly input for each field on one form. Is there a better way than what I have done?
No record of File Replication System, SYSVOL started - DCDIAG Errors
Python: how to check mail status
Importing a .pst into a public folder, I can see all the contents, other users only see "Deleted Items" folder.
Better than fraps