Could not load : can't convert nil into String?

Have you double-checked that the year, month, and monthday fields are defined?

You should convert the fields to integers with %{YEAR:year:int} etc so that you can say

if [year] < 2015 and [month] < 6 and [month_day] < 1 {

instead. As it stands you'll drop all messages from October, November, and December since "10" < "6" is true (but 10 < 6 is false).