How can you isolate the date portion of each request of a IP address if it's at the first line of each request from a log file using awk, creating a list of distinct dates, and then using grep to create a list of requests for each date?

I thought maybe this first:

awk '$1=='$Current_date' {count++} END { print count}' weblog1.txt

to go through each date and count the adress

  • 2
    This site is for questions about Vim. For awk and grep try "Unix & Linux" SE.
    – B Layer
    Oct 28 '20 at 4:56
  • 2
    I’m voting to close this question because it doesn't seem to be about Vi or Vim. Oct 28 '20 at 7:50
  • Agree...off topic. But this may help. If you had a (space-separated in this case) file with dates in first column this will print a sorted list of unique dates and their counts: awk '{ counts[$1]++ } END {for (date in counts) print date ":", counts[date] | "sort"}' filename
    – B Layer
    Oct 28 '20 at 8:12
  • I’m voting to close this question because I also asked the mods for a migration to the U&L.
    – peterh
    Oct 28 '20 at 11:07