# Split a DateTime field to all Documents in logstash

**URL:** https://discuss.elastic.co/t/split-a-datetime-field-to-all-documents-in-logstash/224726
**Category:** Logstash
**Created:** [March 23, 2020, 8:15pm UTC](https://discuss.elastic.co/t/split-a-datetime-field-to-all-documents-in-logstash/224726 "2020-03-23T20:15:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![panwarsagar](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@panwarsagar](https://discuss.elastic.co/u/panwarsagar)
#### Post date: [March 23, 2020, 8:15pm UTC](https://discuss.elastic.co/t/split-a-datetime-field-to-all-documents-in-logstash/224726/1 "2020-03-23T20:15:12Z")

</div>

Hi,

I have a Start\_Time field that I wants to split in all documents using the split filter.  
But split filter only takes string and array, So i tried to use mutate filter to covert Start\_Time field to string. But still getting the same error from Split Plugin that  
_"split - Only String and Array types are splittable. field:Start\_Time is of type = NilClass"_

Any suggestion please

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [March 23, 2020, 10:22pm UTC](https://discuss.elastic.co/t/split-a-datetime-field-to-all-documents-in-logstash/224726/2 "2020-03-23T22:22:35Z")

</div>

> [@panwarsagar](#):
>
> field:Start\_Time is of type = NilClass

That suggests there is an event that does not contain the Start\_Time field.

---

<div class="post-metadata">

### Author: ![panwarsagar](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@panwarsagar](https://discuss.elastic.co/u/panwarsagar)
#### Post date: [March 24, 2020, 10:23am UTC](https://discuss.elastic.co/t/split-a-datetime-field-to-all-documents-in-logstash/224726/3 "2020-03-24T10:23:58Z")

</div>

Hi,

Thanks for support,  
My understanding was not correct for split plugin.  
I will try to explain the problem I am acing here.  
I am parsing some XML files using xml filter, that is working perfectly fine.  
The problem is start\_time field is only available in one Document and rest of the documents does not have a start time. So I wants to put Start\_Time from one document to all of the rest documents.  
Could you please suggest which plugin i can use to achieve this.

{  
"@timestamp" =\> 2020-03-24T09:47:50.807Z,  
"@version" =\> "1",  
"Start\_Time" =\> "2020-03-05T12:57:00+01:00"  
}  
{  
"@timestamp" =\> 2020-03-24T09:47:50.807Z,  
"Measurement\_Results" =\> [  
"1 0 0 0 1 0 0 0 0 0 "  
],  
"End\_Time" =\> [  
"2020-03-05T12:58:00+01:00"  
],  
"@version" =\> "1",  
"Measurement\_Object\_Name" =\> [  
"test"  
],  
"Measurement\_Object" =\> [  
"test-ldn"  
],  
"Measurement\_Info\_ID" =\> [  
"id001"  
],  
"Measurement\_Type" =\> [  
"a b c d e f g h i j"  
]  
}

from the first document i wants to copy "Start\_Time" to document below and so on..

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [March 24, 2020, 12:44pm UTC](https://discuss.elastic.co/t/split-a-datetime-field-to-all-documents-in-logstash/224726/4 "2020-03-24T12:44:18Z")

</div>

> [@panwarsagar](#):
>
> The problem is start\_time field is only available in one Document and rest of the documents does not have a start time. So I wants to put Start\_Time from one document to all of the rest documents.

I suggest you read [this](https://discuss.elastic.co/t/help-with-processing-metadata-at-start-of-file/220740/2).

---

<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: [April 21, 2020, 12:50pm UTC](https://discuss.elastic.co/t/split-a-datetime-field-to-all-documents-in-logstash/224726/5 "2020-04-21T12:50:43Z")

</div>

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