How to get the date object substring in logstash filter

Above quote used in the mysql queries to escape mysql predefined variables. same query written to log. if i use that quote also csv failure exception displayed.
Please suggest another.