# Elasticsearch custom date field issue

**URL:** <https://discuss.elastic.co/t/elasticsearch-custom-date-field-issue/127318>\
**Category:** Elasticsearch\
**Created:** [April 9, 2018, 11:59am UTC](https://discuss.elastic.co/t/elasticsearch-custom-date-field-issue/127318 "2018-04-09T11:59:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxq209](https://avatars.discourse-cdn.com/v4/letter/z/58956e/32.png) [@zxq209](https://discuss.elastic.co/u/zxq209)\
**Post date:** [April 9, 2018, 11:59am UTC](https://discuss.elastic.co/t/elasticsearch-custom-date-field-issue/127318/1 "2018-04-09T11:59:21Z")

</div>

elasticsearch 6.2  
logstash 6.2  
filebeat 6.2

logstash conf

```
 if [type] == "s-response"{
       elasticsearch {
    hosts => ["192.168.4.56:9200","192.168.15.145:9200","192.168.15.41:9200"]
    index => "s-response-%{+YYYY-MM}"
            user=>"elastic"
            password=>"s1!"
}

    stdout { codec => rubydebug }

}

```

and stdout is

```
{
              "code" => "200",
              "tags" => [
    [0] "beats_input_codec_plain_applied",
    [1] "_geoip_lookup_failure"
],
              "host" => "192.168.4.231",
        "spent_time" => 54,
       "application" => "smap-toll-path-link",
              "beat" => {
        "name" => "dbs-233",
    "hostname" => "dbs-233",
     "version" => "6.2.3"
},
           "message" => "OK",
              **"date" => "2018-04-09T19:08:43.430",**
        "prospector" => {
    "type" => "log"
},
            "offset" => 13479,
        "threadName" => "http-nio-8093-exec-5",
          "@version" => "1",
        "loggerName" => "smap_tollgate.controller.TollgateController",
            "source" => "/app/smap/toll/log/smap_toll_allpath_links.2018-04-09.log",
"applicationVersion" => "0.0.1",
              "type" => "s-response",
        **"@timestamp" => 2018-04-09T11:08:49.109Z,**
             "level" => "INFO"

```

}

I found the @timestamp has been deducted 8 hours,and the date field (custom json field) had no change.  
Then I search the data in es,  
192.168.4.56:9200/s-response-2018-04/\_search?q=date:"2018-04-09T19:08:43.430"  
The result is the same with logstatsh.  
But when I use kibana , the "date" (json field) had been increased 8 hours .  
I create the index pattern, and chose the "date" field as "Time Filter field name".

```
The "date": "2018-04-09T19:08:43.430" in es
The date:April 10th 2018, 03:08:43.430 in kibana

```

I just want to use "date" as "Time Filter field name" and I don't want kibana to change the "date".  
What should I do?  
thanks a lot!

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 9, 2018, 2:39pm UTC](https://discuss.elastic.co/t/elasticsearch-custom-date-field-issue/127318/2 "2018-04-09T14:39:53Z")

</div>

Wild guess: If you do not specify a timezone, then UTC is used. Could this be the problem in this case?

---

<div class="post-metadata">

**Author:** ![zxq209](https://avatars.discourse-cdn.com/v4/letter/z/58956e/32.png) [@zxq209](https://discuss.elastic.co/u/zxq209)\
**Post date:** [April 10, 2018, 1:16am UTC](https://discuss.elastic.co/t/elasticsearch-custom-date-field-issue/127318/3 "2018-04-10T01:16:51Z")

</div>

Thanks for yous reply.I need to get the application request real time not filebeat harvesting time.Anything I can do ?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 10, 2018, 7:24am UTC](https://discuss.elastic.co/t/elasticsearch-custom-date-field-issue/127318/4 "2018-04-10T07:24:06Z")

</div>

I do not understand what you are trying to say here, can you elaborate?

---

<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:** [May 8, 2018, 7:24am UTC](https://discuss.elastic.co/t/elasticsearch-custom-date-field-issue/127318/5 "2018-05-08T07:24:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
