# Input ElasticSearch output Redis using Logstash

**URL:** <https://discuss.elastic.co/t/input-elasticsearch-output-redis-using-logstash/59887>\
**Category:** Logstash\
**Created:** [September 6, 2016, 2:28pm UTC](https://discuss.elastic.co/t/input-elasticsearch-output-redis-using-logstash/59887 "2016-09-06T14:28:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit\_Pradhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankit_pradhan/32/44412_2.png) [@Ankit\_Pradhan](https://discuss.elastic.co/u/Ankit_Pradhan)\
**Post date:** [September 6, 2016, 2:28pm UTC](https://discuss.elastic.co/t/input-elasticsearch-output-redis-using-logstash/59887/1 "2016-09-06T14:28:20Z")

</div>

I want to ship Data from Source Elasticsearch to Target ElasticSearch via Redis using Logstash ...

The problem is one field (named as eventTime) which is of type **Date** in Source ElasticSearch index is not getting created as Date (but as **String** ) in Target ElasticSearch

I am using below config:

input {  
# Read all documents from Elasticsearch matching the given query  
elasticsearch {  
hosts =\> "server.ip"  
index =\> "source\_index"  
type =\> "generic-component"  
query =\> '{ "query": { "filtered": { "query": { "match\_all": {} }, "filter": { "range": { "eventTime": { "gte": "now-60s" } } } } }}'  
}

}

filter {

mutate {

```
    add_field => { "log_environment" => "a" }
    add_field => { "host" => "some_ip" }

     } 

     date {
                            match => ["eventTime", "yyyy-MM-dd'T'hh:mm:ss.SSSZ", "ISO8601", "UNIX", "UNIX_MS", "TAI64N"]
                            #timezone => "Europe/Amsterdam"
                            target => "eventTime"

          }

```

}

output {

```
    redis {
        host => "Target_Redis_Buffer.ip"
        data_type => "list"
        key => "logstash"
        codec => json
  }

```

}

In the source eventTime is of this sample values:  
2016-09-01T16:20:00.073+02:00  
2016-09-06T13:34:05.327+0200

I suspect I am goofing up with the Date Mutation but not able figure out what.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 8, 2016, 8:00am UTC](https://discuss.elastic.co/t/input-elasticsearch-output-redis-using-logstash/59887/2 "2016-09-08T08:00:48Z")

</div>

The field was probably mapped as string at some point (when `eventTime` looked differently and couldn't be parsed as a timestamp) and now the mapping can't be changed without reindexing. What if you delete the destination index and try again (forcing a recreation) or leave the existing index alone and simply index into a new index?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:39am UTC](https://discuss.elastic.co/t/input-elasticsearch-output-redis-using-logstash/59887/3 "2017-07-06T04:39:22Z")

</div>


