Substring in logstash

I have a field

enddate = "20160801105021"
I want to create a new field which must contain 8 character of the enddate or must have 0-7 character like
newdate = "20160801"