Dear @Dzmitry.
Im running version 7.9.0.
Server time seems to be ok.
tecnetadmin@ubuntu-elk:~$ sudo dpkg-reconfigure tzdata
Current default time zone: 'America/Argentina/Mendoza'
Local time is now: Sat Sep 26 11:03:37 -03 2020.
Universal Time is now: Sat Sep 26 14:03:37 UTC 2020.
Here is how I build the time string to insert on elastic.
[leo@arch ~]$ cat test.sh
a=$(date "+%F %T")
b="${a/ /T}.000Z"
echo $b
[leo@arch ~]$ bash test.sh
2020-09-26T11:11:08.000Z
Data is geeting stored ok , for example using this littel script:
root@UBUNTU-SMOKE:/opt/lease_parse# cat date.sh
#!/bin/bash
a=$(date "+%F %T")
b="${a/ /T}Z"
echo "$b"
A=1111
C=3333
curl -XPOST "http://172.30.6.113:9200/dhcp_leases/_doc/" -H 'Content-Type: application/json' -d'{"router":"lujan","current":'$A',"previous":'$C',"timestamp":"'$b'"}'
inserting a test document:
root@UBUNTU-SMOKE:/opt/lease_parse# bash date.sh
2020-09-26T11:42:44Z
{"_index":"dhcp_leases","_type":"_doc","_id":"n8rdynQBT4bdce0nv8nQ","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":20,"_primary_term":2}root@UBUNTU-SMOKE:/opt/lease_parse#
Then I can see on kibana (discover) , last inserted register:
Sep 26, 2020 @ 08:42:44.000 (wrong time here)
router:
lujan
current:
1,111
previous:
3,333
timestamp:
Sep 26, 2020 @ 08:42:44.000
_id:
n8rdynQBT4bdce0nv8nQ
_type:
_doc
_index:
dhcp_leases
_score:
-
But if I look on elastic , i have:
GET dhcp_leases/_doc/n8rdynQBT4bdce0nv8nQ
wich returns:
{
"_index" : "dhcp_leases",
"_type" : "_doc",
"_id" : "n8rdynQBT4bdce0nv8nQ",
"_version" : 1,
"_seq_no" : 20,
"_primary_term" : 2,
"found" : true,
"_source" : {
"router" : "lujan",
"current" : 1111,
"previous" : 3333,
"timestamp" : "2020-09-26T11:42:44Z" (time is ok)
}
}
ok thats the complete process.
Please let me know if it is clear or something else to check.
Perhaps need to change the timestamp string format ?
Thanks for your help!!