So here is the situation. I currently run a mail server for my small non-profit company. My mail server (Merak Mail Server) keeps logs in .log files and mail as .tmp files. Essentially these are just text files that are kept on the server.
Problem is that when I put text into the "Containing text" field on Windows Explorer, it always misses the files and tells me no results returned. Then when I search the files one by one (painful at best), I find the files I need.
Do I not understand the search feature well enough, or maybe I have it indexing wrong. I really don't care what I need to use to search the files, even a third-party app is fine with me, I just want to type an email address into a box and search all of my log files or email files and find out which one I am looking for. It can be Windows Search or something else, as long as I can find a way to get the job done I will be happy. Pay solutions are fine as well.
Thanks everyone in advance.
I'd say give WinGrep a shot.
If they're all in a single directory, I can see a two step process helping you out.
Step 1: Command-line
Open a CMD shell and go to the directory you're looking for. Then issue the find command:
It'll then search all files in that directory for the string you're looking for. When it finds one, it'll give you the file name, like this:
Which will tell you which file to go searching inside.
Step 2: Searching inside the file
This step you already know. The first step is just narrowing your search scope.
Use findstr at the command prompt!
You can do this one of 2 ways (well I'm sure there are more but here is what I would do)
Install Microsoft Desktop Search, you can do this on the server or a workstation and have it index the files. It should be able to see they are text files and index the contents. This will be the faster of the 2 ways. This is free btw.
Use an advanced text editor like Notepad++ or Textpad and use the file in files option which will seach though all the files in the directory. But this will take longer when you need to run the search. Notepad++ is free, Textpad has a small cost but is free to try.
If this is something you need to do frequently, I'd go with 1. If its infrequent every now and then thing, try out 2 and see if it works for you.
I like UltraEdit for this. You can tell it to seach all the files in a directory (or limit it to certain file types or any other wildcard) for a string you specify. If it finds your text in multiple files or multiple times in a file, it gives you a list of all the instances it found and clicking on one takes you to that file/location.
Use powershell then:
select-string -path c:\mylogfiledir*.log -pattern "my string"
Note that in powershell v2 you can also use the -context switch to get the lines above and below the line where the match was found
You can use ack 'A grep-like program specifically for large source trees'. Ack is like grep but written in perl (works fine on Windows). These are the reasons why it is supposedly better than grep:
I never you the windows search/find, because of things like this. I usually end up doing a search through a good old command prompt. The results are 99% much faster and more accurate then the Search/Find GUI.
You can even pipe the results into the Find command if you want to search within the results.
Don't forget Logparser can be a good Text parser/search utility as well. The 'TEXTWORD and TEXTLINE input' formats and the 'CSV and TSV input' formats are worth running the logparser -i:INPUTFORMATYOUWISHTOKNOWMOREABOUT -h 'help' call on. There are examples within the 'help' files, too.
I use Agent Ransack and it works great. It also attaches it self to the right-click menu so you can right click the folder and say Agent Ransack and it will search there. Oh and best thing, it's free.
I use this to search inside text files as well as temp folders that normal Search from Windows won't search.
Hope it helps.