# Kibana Timezone incompatiblities

**URL:** <https://discuss.elastic.co/t/kibana-timezone-incompatiblities/262649>\
**Category:** Kibana\
**Created:** [January 29, 2021, 1:07pm UTC](https://discuss.elastic.co/t/kibana-timezone-incompatiblities/262649 "2021-01-29T13:07:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![d3v3lop3r](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d3v3lop3r/32/77472_2.png) [@d3v3lop3r](https://discuss.elastic.co/u/d3v3lop3r)\
**Post date:** [January 29, 2021, 1:07pm UTC](https://discuss.elastic.co/t/kibana-timezone-incompatiblities/262649/1 "2021-01-29T13:07:13Z")

</div>

Hello there,

Iam trying to make my Data visible in the Discover Tab of Kibana and it's just not working out for me.

Iam sitting on a project for my studies and built a weather station. The station submits its data once a minute to the elastic search database:

```auto
    --header 'Authorization: Basic hello' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "properties": {
            "humidity": "80.8926024542",
            "pressure": "999.55501023",
            "temperature": "-2.26",
            "@timestamp": "2021-01-29T13:30:01+01:00"
        }
    }'

```

I put elastic search behind a reverse proxy, thats why there is a basic auth.

The cluster happily acknowledges this and the entry is visible in elastic:

```auto
    "_index": "weather-test",
                    "_type": "_doc",
                    "_id": "tyIkTncBVIHFgv-pcAnD",
                    "_score": 1.0,
                    "_source": {
                        "properties": {
                            "humidity": 72.6349751508,
                            "pressure": 995.37218785,
                            "temperature": 0.33,
                            "@timestamp": "2021-01-29T13:35:46+01:00"
                        }
                    }
                }

```

The Mapping looks as follows:

```auto
    {

        "weather-test": {

            "mappings": {

                "properties": {

                    "@timestamp": {

                        "type": "date",

                        "format": "date_optional_time"

                    },

                    "humidity": {

                        "type": "double"

                    },

                    "pressure": {

                        "type": "double"

                    },

                    "properties": {

                        "properties": {

                            "@timestamp": {

                                "type": "date"

                            },

                            "humidity": {

                                "type": "float"

                            },

                            "pressure": {

                                "type": "float"

                            },

                            "temperature": {

                                "type": "float"

                            }

                        }

                    },

                    "temperature": {

                        "type": "double"

                    }

                }

            }

        }

    }

```

The problem is, that no amount of filtering or tinkering around shows a result in Discover. Here is the request that it sends:

```auto
    {
      "version": true,
      "size": 500,
      "sort": [
        {
          "@timestamp": {
            "order": "desc",
            "unmapped_type": "boolean"
          }
        }
      ],
      "aggs": {
        "2": {
          "date_histogram": {
            "field": "@timestamp",
            "calendar_interval": "1w",
            "time_zone": "Europe/Berlin",
            "min_doc_count": 1
          }
        }
      },
      "stored_fields": [
        "*"
      ],
      "script_fields": {},
      "docvalue_fields": [
        {
          "field": "@timestamp",
          "format": "date_time"
        },
        {
          "field": "properties.@timestamp",
          "format": "date_time"
        }
      ],
      "_source": {
        "excludes": []
      },
      "query": {
        "bool": {
          "must": [],
          "filter": [
            {
              "match_all": {}
            },
            {
              "range": {
                "@timestamp": {
                  "gte": "2020-01-29T13:02:42.164Z",
                  "lte": "2021-01-29T13:02:42.164Z",
                  "format": "strict_date_optional_time"
                }
              }
            }
          ],
          "should": [],
          "must_not": []
        }
      },
      "highlight": {
        "pre_tags": [
          "@kibana-highlighted-field@"
        ],
        "post_tags": [
          "@/kibana-highlighted-field@"
        ],
        "fields": {
          "*": {}
        },
        "fragment_size": 2147483647
      }
    }

```

And the response:

```auto
    {
      "took": 849,
      "timed_out": false,
      "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
      },
      "hits": {
        "total": 0,
        "max_score": null,
        "hits": []
      },
      "aggregations": {
        "2": {
          "buckets": []
        }
      }
    }

```

The elasticsearch server and kibana is running on the same server, a raspberry pi 4 with 4gb ram and the resources arent exhausted in any way.

I also have an index pattern where @timestamp is recognized as a timestamp with the type of date. Its searchable and Aggregatable. With the exception of the timestamp feature this applies also the pressure, humidity and temperature.

 ![index pattern 1](https://us1.discourse-cdn.com/elastic/original/3X/5/b/5bd155f434676206e3a2f86b7f4906540794d3a4.png) ![index pattern 2](https://us1.discourse-cdn.com/elastic/original/3X/4/d/4de8ba69422ba5cc8a4e7b1a7cd36e32bfa3be86.png)

---

<div class="post-metadata">

**Author:** ![d3v3lop3r](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d3v3lop3r/32/77472_2.png) [@d3v3lop3r](https://discuss.elastic.co/u/d3v3lop3r)\
**Post date:** [January 29, 2021, 1:14pm UTC](https://discuss.elastic.co/t/kibana-timezone-incompatiblities/262649/2 "2021-01-29T13:14:00Z")

</div>

I just saw, that the mapping changes from

```auto
{
    "mappings": {
        "properties": {
            "@timestamp": {
                "type": "date",
                "format": "date_optional_time"
            },
            "humidity": {
                "type": "double"
            },
            "pressure": {
                "type": "double"
            },
            "temperature": {
                "type": "double"
            }
        }
    }
}

```

to

```auto
{
    "weather-test": {
        "mappings": {
            "properties": {
                "@timestamp": {
                    "type": "date",
                    "format": "date_optional_time"
                },
                "humidity": {
                    "type": "double"
                },
                "pressure": {
                    "type": "double"
                },
                "properties": {
                    "properties": {
                        "@timestamp": {
                            "type": "date"
                        },
                        "humidity": {
                            "type": "float"
                        },
                        "pressure": {
                            "type": "float"
                        },
                        "temperature": {
                            "type": "float"
                        }
                    }
                },
                "temperature": {
                    "type": "double"
                }
            }
        }
    }
}

```

This is a strange behaivour

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [January 29, 2021, 1:19pm UTC](https://discuss.elastic.co/t/kibana-timezone-incompatiblities/262649/3 "2021-01-29T13:19:17Z")

</div>

The issues is the `properties` object in your document. If you can change your weather station to submit the data as

```auto
{
            "humidity": "80.8926024542",
            "pressure": "999.55501023",
            "temperature": "-2.26",
            "@timestamp": "2021-01-29T13:30:01+01:00"
        }

```

That would be optimal - in that case it will use the mapping you prepared for the index and everything should just work.

What happens is that all of your fields live in a nested "properties" object, so Elasticsearch auto-detects the mapping for this unknown object (these are the additional entries).

If you can't change how the station sends their data, recreate the index pattern and select `properties.@timestamp` as time field, then the data should be retrieved correctly.

Beware: In the mapping all properties are wrapped in `properties`, but that's not part of the documents actually ingested in Elasticsearch, it's just part of the format of the mapping API.

---

<div class="post-metadata">

**Author:** ![d3v3lop3r](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d3v3lop3r/32/77472_2.png) [@d3v3lop3r](https://discuss.elastic.co/u/d3v3lop3r)\
**Post date:** [January 29, 2021, 1:19pm UTC](https://discuss.elastic.co/t/kibana-timezone-incompatiblities/262649/4 "2021-01-29T13:19:38Z")

</div>

I just deleted my Mapping and changed the curl to send the data without the properties attribute. This set the dynamic mapping:

````auto
{
    "weather-test": {
        "mappings": {
            "properties": {
                "@timestamp": {
                    "type": "date"
                },
                "humidity": {
                    "type": "float"
                },
                "pressure": {
                    "type": "float"
                },
                "temperature": {
                    "type": "float"
                }
            }
        }
    }
}```
````

---

<div class="post-metadata">

**Author:** ![d3v3lop3r](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d3v3lop3r/32/77472_2.png) [@d3v3lop3r](https://discuss.elastic.co/u/d3v3lop3r)\
**Post date:** [January 29, 2021, 1:21pm UTC](https://discuss.elastic.co/t/kibana-timezone-incompatiblities/262649/5 "2021-01-29T13:21:24Z")

</div>

That just fixed it! Thank you 🙂

---

<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:** [February 26, 2021, 1:22pm UTC](https://discuss.elastic.co/t/kibana-timezone-incompatiblities/262649/6 "2021-02-26T13:22:01Z")

</div>

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