Logstash how to send string as not_analyzed into elasticsearch

As you say, if creating a dynamic template in Elasticsearch works, then why not referring in Logstash is not working?