Regarding if else condition for grok filter

Depend how date is coming, you can set to: