# Drop json array data and read first event only

**URL:** <https://discuss.elastic.co/t/drop-json-array-data-and-read-first-event-only/370106>\
**Category:** Logstash\
**Created:** [November 6, 2024, 7:14am UTC](https://discuss.elastic.co/t/drop-json-array-data-and-read-first-event-only/370106 "2024-11-06T07:14:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mangeshmj1992](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mangeshmj1992](https://discuss.elastic.co/u/mangeshmj1992)\
**Post date:** [November 6, 2024, 7:14am UTC](https://discuss.elastic.co/t/drop-json-array-data-and-read-first-event-only/370106/1 "2024-11-06T07:14:27Z")

</div>

Hello team,  
Can we drop json array values and send data to elasticsearch only for latest values.

Sample log line:

```auto
{
    "@ad.context": "mydata",
    "value": [
        
        {
            "app_name": "facebook",
            "passwordCredentials": [
                {
                    "endDateTime": "2025-01-01T11:07:13.6718884Z"
                },
                {
                    "endDateTime": "2024-11-15T11:07:13.6718884Z"
                },
                {
                    "endDateTime": "2024-10-28T11:07:13.6718884Z"
                }
            ]
        }
    ]
}

```

I have three passwordCredentials end date for one application I need to read only latest value i.e "endDateTime": "2025-01-01T11:07:13.6718884Z", and drop all other fields.
