# Parsing field on conf file

**URL:** <https://discuss.elastic.co/t/parsing-field-on-conf-file/141923>\
**Category:** Logstash\
**Created:** [July 27, 2018, 10:48am UTC](https://discuss.elastic.co/t/parsing-field-on-conf-file/141923 "2018-07-27T10:48:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jagan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jagan/32/42200_2.png) [@jagan](https://discuss.elastic.co/u/jagan)\
**Post date:** [July 27, 2018, 10:48am UTC](https://discuss.elastic.co/t/parsing-field-on-conf-file/141923/1 "2018-07-27T10:48:28Z")

</div>

Hi Mate,  
Could you please suggest me how do i parse my field (i.e age) which has value as [0-10)[10-20)....While parsing my fields how do i do in my conf file ?(by default logstash takes every field as string ).

Thanks in advance,  
Jagan

---

<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:** [July 27, 2018, 6:08pm UTC](https://discuss.elastic.co/t/parsing-field-on-conf-file/141923/2 "2018-07-27T18:08:31Z")

</div>

It's not clear what you want to accomplish. You have a string field containing an age, right? So what do you want to do with it? Convert it to an integer? Something else?

---

<div class="post-metadata">

**Author:** ![jagan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jagan/32/42200_2.png) [@jagan](https://discuss.elastic.co/u/jagan)\
**Post date:** [July 30, 2018, 4:09am UTC](https://discuss.elastic.co/t/parsing-field-on-conf-file/141923/3 "2018-07-30T04:09:43Z")

</div>

Thanks magnus,  
sorry for late response,yes,what you said is correct my dataset says age has a group [0-10],[10-20] which would be shown as string in ES.  
I have one question is do i need to convert to integer or any other datatype?

Thanks,  
jagan

---

<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:** [August 1, 2018, 6:05am UTC](https://discuss.elastic.co/t/parsing-field-on-conf-file/141923/4 "2018-08-01T06:05:36Z")

</div>

> sorry for late response,yes,what you said is correct my dataset says age has a group [0-10],[10-20] which would be shown as string in ES.

It's not clear exactly what "has a group [0-10],[10-20]" means.

> I have one question is do i need to convert to integer or any other datatype?

Not necessarily, but if the string field always contains an integer I don't see a reason _not_ to convert it to an integer field.

---

<div class="post-metadata">

**Author:** ![jagan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jagan/32/42200_2.png) [@jagan](https://discuss.elastic.co/u/jagan)\
**Post date:** [August 1, 2018, 8:20am UTC](https://discuss.elastic.co/t/parsing-field-on-conf-file/141923/5 "2018-08-01T08:20:22Z")

</div>

Thank magnus,  
the age field is left as default it is not causing any issue .Thanks for the clarification

---

<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:** [August 29, 2018, 8:20am UTC](https://discuss.elastic.co/t/parsing-field-on-conf-file/141923/6 "2018-08-29T08:20:27Z")

</div>

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