ok so if I understand well I need to create another index with the following script:
POST _reindex
{
"source": {
"index": "my-index-000001",
"TIME": {
"type": "string"
}
},
"dest": {
"index": "my-new-index-000001",
"TIME": {
"type": "string"
}
}
}
but instead of doing it is not easier to do as following?
```
consumer = KafkaConsumer(
'stream',
bootstrap_servers=['localhost:9092'],
auto_offset_reset='earliest',
enable_auto_commit=True,
group_id='my-group-id',
value_deserializer=lambda x: loads(x.decode('utf-8')))
i=0
indexVal="provaTempi"
es=Elasticsearch([{'host': 'localhost', 'port': 9200}])
for event in consumer:
dt_string=event.value['DATE']+" "+event.value['TIME']
print(dt_string)
format1='%m/%d/%y %H:%M:%S'
data=event.value
timestampRow=datetime.datetime.strptime(dt_string,format1)
event_data = {'START TIME': data['START TIME'], 'DATE': data['DATE'], 'TIME': data['TIME'], 'TIMESTAMP': timestampRow, }
i=i+1
res=es.index(index=indexVal,id=i, body=event.data)
So according to this script I manage to insert date type into kibana. After creating the patterns on kibana I manage to see the date datatype for TIMESTAMP. With the same pattern of converting date+time I do the same for single like START TIME value as ok?
Thanks