Monday, April 18, 2016

Extract a specifc parameter value from HTTP log and calculate unique count

To extract a specifc parameter (say `name`) value from HTTP log and calculate unique count,

use the following command:

cat logs/http/http.log.2016-04-17.? | grep -o -P '(?<=name=)[^&]*(?=&)'

Reference:
http://stackoverflow.com/questions/13242469/how-to-use-sed-grep-to-extract-text-between-two-words

No comments:

Post a Comment