# Assign a value from a line before if field has no value present

**URL:** <https://discuss.elastic.co/t/assign-a-value-from-a-line-before-if-field-has-no-value-present/235097>\
**Category:** Logstash\
**Created:** [June 1, 2020, 12:28am UTC](https://discuss.elastic.co/t/assign-a-value-from-a-line-before-if-field-has-no-value-present/235097 "2020-06-01T00:28:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hazal](https://avatars.discourse-cdn.com/v4/letter/h/73ab20/32.png) [@hazal](https://discuss.elastic.co/u/hazal)\
**Post date:** [June 1, 2020, 12:28am UTC](https://discuss.elastic.co/t/assign-a-value-from-a-line-before-if-field-has-no-value-present/235097/1 "2020-06-01T00:28:26Z")

</div>

Hey,

I wonder that is it possible to assign data to a blank field from a line appeared before in logstash?

I mean there is a csv file, and in this csv file, some lines' date field does not have value because these lines prepared to be the continuation of the first line before them.

Like this:

```auto
    4/1/2020 9:33:50 AM,1234567890:main (1234567890),,IVR (123),answered,00:00:01,00:00:24,,,IVR (123) replaced by Q callcenter (100),
    ,1234567890:main (1234567890),,Q callcenter (100),answered,00:00:00,00:00:37,,,Q callcenter (100) replaced by (122),
    ,1234567890:main (1234567890),,xyz (123),answered,00:00:06,00:00:00,,,Picked up by xyz (122),

```

I have to assign value which appear in the first line ( 4/1/2020 9:33:50 AM) to second and third lines.  
I read [this topic](https://discuss.elastic.co/t/assign-a-value-if-field-has-no-value-present/193578/2) and understand assign a specific value to an empty field, but is it possible that to assign a value from the other line?

Or Is there anything you can recommend to me?

Regards.

---

<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 29, 2020, 12:28am UTC](https://discuss.elastic.co/t/assign-a-value-from-a-line-before-if-field-has-no-value-present/235097/2 "2020-06-29T00:28:26Z")

</div>

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