# Live index data transformation by using ingest pipeline

**URL:** <https://discuss.elastic.co/t/live-index-data-transformation-by-using-ingest-pipeline/359975>\
**Category:** Elasticsearch\
**Created:** [May 22, 2024, 9:21am UTC](https://discuss.elastic.co/t/live-index-data-transformation-by-using-ingest-pipeline/359975 "2024-05-22T09:21:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![PavanSatya](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@PavanSatya](https://discuss.elastic.co/u/PavanSatya)\
**Post date:** [May 22, 2024, 9:21am UTC](https://discuss.elastic.co/t/live-index-data-transformation-by-using-ingest-pipeline/359975/1 "2024-05-22T09:21:18Z")

</div>

Dear Team,

I'm new to ELK stack and need your support on this,

I had an index where live date in coming form the kafka.  
Recently I had converted string data to date format by using the ingest pipeline.  
After that I had created reindexing to the new index, but here the problem started,  
After creating new Index the date field was showing (new field created by converting string to date in ingest pipeline).  
I want to know that if the new date coming to this index will be transformed or should we need to do any changes in order to reflect the new data in replicated index.

Thanks and Regards,  
Pavan Satya.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 22, 2024, 10:17am UTC](https://discuss.elastic.co/t/live-index-data-transformation-by-using-ingest-pipeline/359975/2 "2024-05-22T10:17:17Z")

</div>

Welcome!

Could you illustrate this with an example of before vs after?

---

<div class="post-metadata">

**Author:** ![PavanSatya](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@PavanSatya](https://discuss.elastic.co/u/PavanSatya)\
**Post date:** [May 22, 2024, 11:43am UTC](https://discuss.elastic.co/t/live-index-data-transformation-by-using-ingest-pipeline/359975/3 "2024-05-22T11:43:17Z")

</div>

Hi Dadoonet,

We are having data in the following Fields:  
lastModifiedDate: 2024-05-20 18:49:35.236

By using Ingest pipeline we had transformed it as followed in a new field.  
last\_Modified\_Date:  
May 20, 2024 @ 21:49:35.236

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

After Doing this change, we had reindexed the old index as followed. (by giving ingest pipeline).

```auto
POST /_reindex
{
  "source": {
    "index": "testforresponsetimestringtodate"
  },
  "dest": {
    "index": "testforresponsetimestringtodate2",
    "pipeline": "testing_for_string2Date"
  }
}

```

Here I need to know that. For original Index (testforresponsetimestringtodate)  
we are getting live data from the servers. So we want this data need to be reflected in new index (testforresponsetimestringtodate2) with date transformation.

Hope this will give you better understanding on this.

1. If we give default pipeline for the original index, then it will give transformed data (date transformation) for the new upcoming data?  
if there is any other solution. kindly let me know.

Thanks and Regards,  
Pavan.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 22, 2024, 12:40pm UTC](https://discuss.elastic.co/t/live-index-data-transformation-by-using-ingest-pipeline/359975/4 "2024-05-22T12:40:38Z")

</div>

Why not writing the data to testforresponsetimestringtodate2 then? Instead of writing in the first one, then reading, then reindex everything a second time?

---

<div class="post-metadata">

**Author:** ![PavanSatya](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@PavanSatya](https://discuss.elastic.co/u/PavanSatya)\
**Post date:** [May 22, 2024, 1:12pm UTC](https://discuss.elastic.co/t/live-index-data-transformation-by-using-ingest-pipeline/359975/5 "2024-05-22T13:12:10Z")

</div>

Hi David,

I didn't get you,  
Could you please clarify me more on this.

Thanks and Regards,  
Pavan.

---

<div class="post-metadata">

**Author:** ![PavanSatya](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@PavanSatya](https://discuss.elastic.co/u/PavanSatya)\
**Post date:** [May 22, 2024, 2:14pm UTC](https://discuss.elastic.co/t/live-index-data-transformation-by-using-ingest-pipeline/359975/6 "2024-05-22T14:14:08Z")

</div>

Let me put this clearly,

Transformed the data (date from "2024-05-20 18:48:16.063" to "May 20, 2024 @ 21:48:16.063"). So, in order to do that I had used data ingest pipeline (date transformation with creating a new field).  
After that I had reindexed it with giving default pipeline as " ingest pipeline " which I created.  
My ultimate goal is to transform the new data that is coming to the index (either it may be new index or old one).  
I want to see the new data in this format "May 20, 2024 @ 21:48:16.063" (which I did in ingest pipeline) that need to be shown continually in the index field. Kindly help me here how to do that.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 22, 2024, 7:10pm UTC](https://discuss.elastic.co/t/live-index-data-transformation-by-using-ingest-pipeline/359975/7 "2024-05-22T19:10:06Z")

</div>

It's "just" a formatting issue?

What does your pipeline look like?

---

<div class="post-metadata">

**Author:** ![PavanSatya](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@PavanSatya](https://discuss.elastic.co/u/PavanSatya)\
**Post date:** [May 23, 2024, 8:32am UTC](https://discuss.elastic.co/t/live-index-data-transformation-by-using-ingest-pipeline/359975/8 "2024-05-23T08:32:45Z")

</div>

Hi David,

This is the pipeline transformation we used.

```auto
[
  {
    "date": {
      "field": "lastModifiedDate",
      "formats": [
        "yyyy-MM-dd HH:mm:ss.SSS",
        "ISO8601"
      ],
      "target_field": "last_updatedtime",
      "output_format": "MM DD, yyyy @ HH:mm:ss.SSS"
    }
  },
  {
    "date": {
      "field": "createdDate",
      "formats": [
        "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
        "yyyy-MM-ddTHH:mm:ss.SSSXXX",
        "ISO8601"
      ],
      "target_field": "Ordercreatedtime",
      "output_format": "MM DD, yyyy @ HH:mm:ss.SSS"
    }
  }
]

```

We are getting data from Elasticsearch Service Sink Connector and we want to transform the date's in to correct format with new field names. It was working fine when I tested it with sample data. Now we want to get transformed date for the new upcoming data in the same Index.

Help me in this.  
From the code "lastModifiedDate" and "createdDate" are the raw data that we are getting. In pipeline we transformed them by giving new field names "Ordercreatedtime" and "last\_updatedtime".

We want this new fields need to be reflected in index.

Thanks and Regards,  
Pavan.
