# Dateparsefailure reason not known

**URL:** https://discuss.elastic.co/t/dateparsefailure-reason-not-known/101650
**Category:** Logstash
**Created:** [September 25, 2017, 7:30am UTC](https://discuss.elastic.co/t/dateparsefailure-reason-not-known/101650 "2017-09-25T07:30:21Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![raja\_gopal](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@raja\_gopal](https://discuss.elastic.co/u/raja_gopal)
#### Post date: [September 25, 2017, 7:30am UTC](https://discuss.elastic.co/t/dateparsefailure-reason-not-known/101650/1 "2017-09-25T07:30:21Z")

</div>

I am running logstash 5 on rhel 6. I am trying to get xml data as input and format it through xml filter plugin. I store the output into a target field and i try to parse a UNIX type date in one of the fields inside the target array. But the result says \_dateparsefailure and the reason is not known.  
i will paste the config file here

```
            xml {
                    store_xml => true
                    source => message
                    target => parsed_message
            }
            mutate {
                    #convert => {"[parsed_message][LastChangedAt]" => "integer"}
            }
            date {
                    match => ["[parsed_message][LastChangedAt]","UNIX" ]
                    target => "last_changed_timestamp"
            }

```

and the input i am giving is

Could someone help me

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [September 25, 2017, 7:38am UTC](https://discuss.elastic.co/t/dateparsefailure-reason-not-known/101650/2 "2017-09-25T07:38:32Z")

</div>

If you format your XML as preformatted text it'll actually come through. Hint: Use the preview pane before posting.

Seeing an example event produced by Logstash would also be helpful.

---

<div class="post-metadata">

### Author: ![raja\_gopal](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@raja\_gopal](https://discuss.elastic.co/u/raja_gopal)
#### Post date: [September 25, 2017, 7:41am UTC](https://discuss.elastic.co/t/dateparsefailure-reason-not-known/101650/3 "2017-09-25T07:41:05Z")

</div>

`<LastChangedAt><![CDATA[1505469213]]></LastChangedAt>`

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [September 25, 2017, 7:51am UTC](https://discuss.elastic.co/t/dateparsefailure-reason-not-known/101650/4 "2017-09-25T07:51:07Z")

</div>

Seeing an example event produced by Logstash would also be helpful.

---

<div class="post-metadata">

### Author: ![raja\_gopal](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@raja\_gopal](https://discuss.elastic.co/u/raja_gopal)
#### Post date: [September 25, 2017, 7:53am UTC](https://discuss.elastic.co/t/dateparsefailure-reason-not-known/101650/5 "2017-09-25T07:53:11Z")

</div>

> [@raja\_gopal](#):
>
> LastChangedAt

What happens is the output comes like "LastChangedAt":["1505469213"] and logstash date filter is not working on this array value. If i just give "LastChangedAt": "1505469213", it is working fine.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [September 25, 2017, 8:20am UTC](https://discuss.elastic.co/t/dateparsefailure-reason-not-known/101650/6 "2017-09-25T08:20:58Z")

</div>

If it's an array you need to address the field accordingly, i.e. with `[parsed_message][LastChangedAt][0]` instead of `[parsed_message][LastChangedAt]`.

---

<div class="post-metadata">

### Author: ![raja\_gopal](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@raja\_gopal](https://discuss.elastic.co/u/raja_gopal)
#### Post date: [September 25, 2017, 9:55am UTC](https://discuss.elastic.co/t/dateparsefailure-reason-not-known/101650/7 "2017-09-25T09:55:33Z")

</div>

Thanks magnusbaeck

---

<div class="post-metadata">

### Author: ![raja\_gopal](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@raja\_gopal](https://discuss.elastic.co/u/raja_gopal)
#### Post date: [September 25, 2017, 9:57am UTC](https://discuss.elastic.co/t/dateparsefailure-reason-not-known/101650/8 "2017-09-25T09:57:10Z")

</div>

I also used force\_array =\> false in xml filter to make it more easier

---

<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: [October 23, 2017, 9:57am UTC](https://discuss.elastic.co/t/dateparsefailure-reason-not-known/101650/9 "2017-10-23T09:57:26Z")

</div>

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