# Can't write data to elasticsearch (cannot be changed from type \[date\] to \[text)

**URL:** <https://discuss.elastic.co/t/cant-write-data-to-elasticsearch-cannot-be-changed-from-type-date-to-text/330062>\
**Category:** Elasticsearch\
**Created:** [April 15, 2023, 9:08am UTC](https://discuss.elastic.co/t/cant-write-data-to-elasticsearch-cannot-be-changed-from-type-date-to-text/330062 "2023-04-15T09:08:09Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Indeed2000](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@Indeed2000](https://discuss.elastic.co/u/Indeed2000)\
**Post date:** [April 15, 2023, 11:18am UTC](https://discuss.elastic.co/t/cant-write-data-to-elasticsearch-cannot-be-changed-from-type-date-to-text/330062/9 "2023-04-15T11:18:19Z")

</div>

@Christian_Dahlqvist someone do this,

> [@InfluxDB input plugin for logstash](https://discuss.elastic.co/t/influxdb-input-plugin-for-logstash/107670/2):
>
> I have got some other approach for connecting to influxDB as an input plugin : input { http\_poller { urls =\> { cpu =\> { user =\> "\*\*\*\*\*" password =\> "\*\*\*\*\*" url =\> "http://localhost:8086/query?pretty=true&db=inspectit&q=SELECT+\*+FROM+cpu" headers =\> { Accept =\> "application/json } } } } } filter { split { field =\> "results" } split { field =\> "[results][series]" } split { field =\> "[results][series][values]…

```auto
filter {
split {
    field => "results"
}
split {
    field => "[results][series]"
}
split {
    field => "[results][series][values]"
	
	
}
if[name]== "cpu"
{
	ruby 
	{

	 #event.set(event.get("[results][series][columns][0]"),event.get("[results][series][values][0])")
	  code => '
				
				 event.set(event.get("[results][series][columns][0]"),event.get("[results][series][values][0]"))
	
  '

	}
}

```

any idea?

---

_[View the full topic](https://discuss.elastic.co/t/cant-write-data-to-elasticsearch-cannot-be-changed-from-type-date-to-text/330062)._
