title: How to grep only the last 30 days of input from a log file?
body: <p>I want to see the all the packages that were upgraded in the last 30 days.</p>
  
  <p>So I run this command:</p>
  
  <pre><code>cat /var/log/apt/history.log | grep -a -A 2 Upgrade
  </code></pre>
  
  <p>I get this output:</p>
  
  <pre><code>...
  
  Upgrade: gcc-8-base:amd64 (8.3.0-6ubuntu1~18.04.1, 8.3.0-26ubuntu1~18.04), libgcc1:amd64 (1:8.3.0-6ubuntu1~18.04.1, 1:8.3.0-26ubuntu1~18.04), libstdc++6:amd64 (8.3.0-6ubuntu1~18.04.1, 8.3.0-26ubuntu1~18.04)
  End-Date: 2020-03-24  10:01:31
  
  --
  Upgrade: libsasl2-2:amd64 (2.1.27~101-g0780600+dfsg-3ubuntu2, 2.1.27~101-g0780600+dfsg-3ubuntu2.1)
  End-Date: 2020-03-24  10:01:35
  
  --
  Upgrade: libsystemd0:amd64 (237-3ubuntu10.33, 237-3ubuntu10.38), libpam-systemd:amd64 (237-3ubuntu10.33, 237-3ubuntu10.38), systemd:amd64 (237-3ubuntu10.33, 237-3ubuntu10.38), libnss-systemd:amd64 (237-3ubuntu10.33, 237-3ubuntu10.38)
  End-Date: 2020-03-24  10:01:43
  
  --
  Upgrade: vim-common:amd64 (2:8.0.1453-1ubuntu1.1, 2:8.0.1453-1ubuntu1.3), vim-runtime:amd64 (2:8.0.1453-1ubuntu1.1, 2:8.0.1453-1ubuntu1.3), vim:amd64 (2:8.0.1453-1ubuntu1.1, 2:8.0.1453-1ubuntu1.3), vim-tiny:amd64 (2:8.0.1453-1ubuntu1.1, 2:8.0.1453-1ubuntu1.3)
  End-Date: 2020-03-24  10:01:49
  
  --
  Upgrade: linux-headers-generic:amd64 (4.15.0.74.76, 4.15.0.91.83), linux-image-generic:amd64 (4.15.0.74.76, 4.15.0.91.83), linux-generic:amd64 (4.15.0.74.76, 4.15.0.91.83)
  End-Date: 2020-03-24  10:02:29
  
  --
  Upgrade: git:amd64 (1:2.17.1-1ubuntu0.5, 1:2.17.1-1ubuntu0.7)
  End-Date: 2020-04-27  08:31:00
  
  --
  Upgrade: git-man:amd64 (1:2.17.1-1ubuntu0.5, 1:2.17.1-1ubuntu0.7)
  End-Date: 2020-04-27  08:31:06
  
  --
  Upgrade: python3-apport:amd64 (2.20.9-0ubuntu7.12, 2.20.9-0ubuntu7.14)
  End-Date: 2020-04-27  08:31:09
  
  --
  Upgrade: python3-problem-report:amd64 (2.20.9-0ubuntu7.12, 2.20.9-0ubuntu7.14)
  End-Date: 2020-04-27  08:31:12
  
  --
  Upgrade: apport:amd64 (2.20.9-0ubuntu7.12, 2.20.9-0ubuntu7.14)
  End-Date: 2020-04-27  08:31:20
  
  
  ...
  </code></pre>
  
  <p>Now I want to grep only the lines that were appended to the file in the last 30 days. And I want it to be relevant to my current time always, so I don't have to change the syntax and dates every time I run the command, so always 30 days. As you can see there are dates in the lines so it should be possible but the syntax is to complex for me.</p>