we have logs like this
more log
20/08/02 13:41:39 some text
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB
20/08/02 13:41:40 some text
20/08/02 13:41:41 some text
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2347
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2347
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2347
20/08/02 13:41:42 some text
20/08/02 13:41:43 some text
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2347
I want to match only the lines with date
so we do that
echo "$(date +"%Y/%m/%d")"
it gives us
2020/08/02
but when we try to grep the date to log we not get any output
example:
grep "$(date +"%Y/%m/%d")" log
what is wrong with my grep syntax
?
expected output
20/08/02 13:41:39 some text
20/08/02 13:41:40 some text
20/08/02 13:41:41 some text
20/08/02 13:41:42 some text
20/08/02 13:41:43 some text