# How to parse ccda raw xml file using logstash

**URL:** <https://discuss.elastic.co/t/how-to-parse-ccda-raw-xml-file-using-logstash/209266>\
**Category:** Logstash\
**Created:** [November 25, 2019, 9:36am UTC](https://discuss.elastic.co/t/how-to-parse-ccda-raw-xml-file-using-logstash/209266 "2019-11-25T09:36:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rameshkr1994](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshkr1994/32/59029_2.png) [@rameshkr1994](https://discuss.elastic.co/u/rameshkr1994)\
**Post date:** [November 25, 2019, 9:36am UTC](https://discuss.elastic.co/t/how-to-parse-ccda-raw-xml-file-using-logstash/209266/1 "2019-11-25T09:36:53Z")

</div>

Dear All.

i have some use to parse or directly point Elasticsearch to query DSL on top of raw ccda xml file.

`below is the demo ccdaraw.xml file link:`  
link [raw CCDA.xml file](https://github.com/jmandel/sample_ccdas/blob/master/HL7%20Samples/CCD.sample.xml)

Note : we have huge number of raw CCDA.xml file and we want to query DSL directly or we can create seperate index like :- demography ,medication ,result so on.....

> Note : - this is very useful for healthcare industries and we are facing this issue please some help about this .

Thanks  
HadoopHelp

---

<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:** [November 25, 2019, 3:06pm UTC](https://discuss.elastic.co/t/how-to-parse-ccda-raw-xml-file-using-logstash/209266/2 "2019-11-25T15:06:52Z")

</div>

Have you tried using an xml filter?

---

<div class="post-metadata">

**Author:** ![rameshkr1994](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshkr1994/32/59029_2.png) [@rameshkr1994](https://discuss.elastic.co/u/rameshkr1994)\
**Post date:** [November 26, 2019, 6:53am UTC](https://discuss.elastic.co/t/how-to-parse-ccda-raw-xml-file-using-logstash/209266/3 "2019-11-26T06:53:49Z")

</div>

Hi @Badger.

Thanks

I tried but not success !!!

below is code for finding :

> input {  
> file {  
> path =\> "D:/RameshKumar/ccdnew.xml"  
> sincedb\_path =\> "CCD.xml" #removed "NULL" \>AND ADDED FILE NAME  
> start\_position =\> beginning

}  
}  
filter {  
xml {  
store\_xml =\> false  
source =\> "message"  
target =\> "" #ADDED

xpath =\>  
[  
"/ClinicalDocument/documentInfo/source/text()", "sourcedata",  
"/ClinicalDocument/documentInfo/type/text()","type11"

```
		]

```

}

}  
output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "healthdata11"  
}  
stdout  
{  
codec =\> rubydebug  
}  
}.

`but we want to parse all tags content like result,medication,demography etc....`

Thanks  
HadoopHelp

---

<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:** [November 26, 2019, 1:52pm UTC](https://discuss.elastic.co/t/how-to-parse-ccda-raw-xml-file-using-logstash/209266/4 "2019-11-26T13:52:56Z")

</div>

> [@rameshkr1994](#):
>
> but we want to parse all tags content

Set store\_xml =\> true and set a value for target.

---

<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:** [December 24, 2019, 1:52pm UTC](https://discuss.elastic.co/t/how-to-parse-ccda-raw-xml-file-using-logstash/209266/5 "2019-12-24T13:52:58Z")

</div>

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