I have a 400MB+ Tomcat log file (catalina.out). How can I pull out entries for a given time period?
How can I get entries for a given time period from a 400MB+ log file?
files;logs;text;filter
Not sure if this would work well for your 400MB file, but here are some CLI one liners that would do the trick.If you're looking for entries for a specific date, grep -c can probably do what you need.Otherwise, you could probably use sed:sed -n '/date1/,/date2/p' filenameFor example with an input file test:Day 0: fooDay 1: helloDay 2: worldDay 3: blahYou could run[me@mybox tmp]$ sed -n '/Day 1/,/Day 2/p' testDay 1: helloDay 2: world