# The best way to parse CDRs

**URL:** <https://discuss.elastic.co/t/the-best-way-to-parse-cdrs/87899>\
**Category:** Logstash\
**Created:** [June 1, 2017, 11:56am UTC](https://discuss.elastic.co/t/the-best-way-to-parse-cdrs/87899 "2017-06-01T11:56:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abelgana](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@abelgana](https://discuss.elastic.co/u/abelgana)\
**Post date:** [June 1, 2017, 11:56am UTC](https://discuss.elastic.co/t/the-best-way-to-parse-cdrs/87899/1 "2017-06-01T11:56:24Z")

</div>

Hi,

I have a CDR file that I would like to parse. The file looks like this:

* * *

Thu Jun 1 06:00:00 2017  
NAS-Identifier = 'TOR'  
Acct-Status-Type = Stop  
NAS-IP-Address = 10.2.1.16  
NAS-Port = 5060

## Thu Jun 1 06:10:00 2017 NAS-Identifier = 'MTRL' Acct-Status-Type = Stop NAS-IP-Address = 10.9.1.14 NAS-Port = 5060

What is the best way to parse it using logstash. My first Idea is to 'awk' the file and format it in Json format and then parse it on logstash. If there is a better way please let me know.

Thanks,

---

<div class="post-metadata">

**Author:** ![abelgana](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@abelgana](https://discuss.elastic.co/u/abelgana)\
**Post date:** [June 6, 2017, 2:23pm UTC](https://discuss.elastic.co/t/the-best-way-to-parse-cdrs/87899/2 "2017-06-06T14:23:15Z")

</div>

I used kv. I will close this one.

---

<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:** [July 4, 2017, 2:23pm UTC](https://discuss.elastic.co/t/the-best-way-to-parse-cdrs/87899/3 "2017-07-04T14:23:24Z")

</div>

Closed on July 4, 2017, 2:23pm UTC

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