Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

grep request differences

hi,

what are differences between below 3 grep requests


zgrep 'RPT|O|BundleShowing' nine.log.20171029.gz | grep 'Oct-29 23:' | wc -l


zgrep 'RPT|O|BundleShow' nine.log.20171029.gz | grep 'Oct-29 23:' | wc -l



zgrep 'RPT|O|BundleShowing' nine.log.20171029.gz | grep 'Oct-29 23:24' | wc -l


if i have to search from yesterday 11 pm till today morning say 6am how to refine my query.

please advise
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

any good links or resources on this kind of sample queries?
Avatar of gudii9

ASKER

grep may not be the best tool for matching a range of times
what is the best tool
How tolerant are you of matching more than requested?  Do you mind getting all of yesterday, or all of today?
How about missing yesterday from 11pm to 11:59:59?
my requirement keep changing. tomorrow i may want to search on whole last week data or whole last month date.

any perfect examples to tweak those example queries?
Avatar of gudii9

ASKER

The first and third may not match BundleShowstoppers or BundleShowcasing
does second match?
is it like wild card search if i do as below

zgrep 'RPT|O|BundleShow' nine.log.20171029.gz | grep 'Oct-29 23:' | wc -l


is above same as below (lets say 4th one)

zgrep 'RPT|O|BundleShow*' nine.log.20171029.gz | grep 'Oct-29 23:' | wc -l
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
1. Provided best solution and answer to next queries
2. Tested given solutions
3. Inactive for 14 days