# Why ingest pipline first field is default date, How can I set it string?

**URL:** https://discuss.elastic.co/t/why-ingest-pipline-first-field-is-default-date-how-can-i-set-it-string/304168
**Category:** Kibana
**Tags:** ingest-pipeline
**Created:** [May 7, 2022, 8:50am UTC](https://discuss.elastic.co/t/why-ingest-pipline-first-field-is-default-date-how-can-i-set-it-string/304168 "2022-05-07T08:50:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![kiddingl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kiddingl/32/104644_2.png) [@kiddingl](https://discuss.elastic.co/u/kiddingl)
#### Post date: [May 7, 2022, 8:50am UTC](https://discuss.elastic.co/t/why-ingest-pipline-first-field-is-default-date-how-can-i-set-it-string/304168/1 "2022-05-07T08:50:47Z")

</div>

My kibane and es version is 7.8.0  
I create a pipline on kibana dashboard

```auto
{
  "description": "test",
  "processors": [
    {
      "grok": {
        "field": "message",
        "patterns": ["%{DATA:a1} %{GREEDYDATA:content}"],
        "on_failure": [
          {
            "set": {
              "field": "grok_fail_message",
              "value": "{{_ingest.on_failure_message }}"
            }
          }
        ]
      }
      
    },
    {
  "remove": {
    "field": ["log.offset","input.type","_type"]
  }
}
    ]
  
}

```

I get the response:

```auto
{
  "acknowledged" : true
}

```

I found the a1 type is alwyas date , why did appear it:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/6/f6cd64d3ffebdfd7aa8940532c12c7c664f856a0.png)

---

<div class="post-metadata">

### Author: ![kiddingl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kiddingl/32/104644_2.png) [@kiddingl](https://discuss.elastic.co/u/kiddingl)
#### Post date: [May 7, 2022, 8:53am UTC](https://discuss.elastic.co/t/why-ingest-pipline-first-field-is-default-date-how-can-i-set-it-string/304168/2 "2022-05-07T08:53:14Z")

</div>

Look this:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/0/604d711460be271d1362f043b09490bed70a3d8f.png)

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 7, 2022, 7:06pm UTC](https://discuss.elastic.co/t/why-ingest-pipline-first-field-is-default-date-how-can-i-set-it-string/304168/3 "2022-05-07T19:06:17Z")

</div>

Most likely because the first field that got processed and inserted fit the `date` format and so Elasticsearch automatically created that field as a type `date`...

If you want to make sure keyword or text? Create a mapping ahead of time.

Or you can use the [mutate convert](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-convert) to set the type to `string`

---

<div class="post-metadata">

### Author: ![kiddingl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kiddingl/32/104644_2.png) [@kiddingl](https://discuss.elastic.co/u/kiddingl)
#### Post date: [May 8, 2022, 2:27am UTC](https://discuss.elastic.co/t/why-ingest-pipline-first-field-is-default-date-how-can-i-set-it-string/304168/4 "2022-05-08T02:27:58Z")

</div>

The pipline is ingest node pipline and not logstash pipline; I try to change a1 type is string ,but it't not activate, base on [Convert processor | Elasticsearch Guide [8.2] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/convert-processor.html)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/1/b1ebdc30166fa56b37016226b209d6d325341263.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/c/7c76505c824ef385b2abe5c61131df2b01f93dda.png)

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 8, 2022, 2:31am UTC](https://discuss.elastic.co/t/why-ingest-pipline-first-field-is-default-date-how-can-i-set-it-string/304168/5 "2022-05-08T02:31:39Z")

</div>

Apologies should have noticed ingest pipeline.

Create a mapping that is the most prescriptive... The same thing is probably happening.. Even though you convert to a string, it has a date format so it's probably getting automatically converted when it's written into a date by [automatic date detection](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-field-mapping.html#date-detection)

You will need to delete the current index because once it's set it won't change.

Explicitly Add the a1 field to the filebeat template as a `text` or `keyword`

If you had run `./filebeat setup -e` per the quick start guide the default filebeat template would have set date `"date_detection": false,` and this would not be happening.

Or you can create a mapping and set `"date_detection": false,`

---

<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: [June 5, 2022, 2:31am UTC](https://discuss.elastic.co/t/why-ingest-pipline-first-field-is-default-date-how-can-i-set-it-string/304168/6 "2022-06-05T02:31:48Z")

</div>

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