# 어떤 필터를 사용해야 하나요?

**URL:** <https://discuss.elastic.co/t/topic/141287>\
**Category:** 한국어 질문 및 토론\
**Created:** [July 24, 2018, 4:12am UTC](https://discuss.elastic.co/t/topic/141287 "2018-07-24T04:12:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghcho](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@ghcho](https://discuss.elastic.co/u/ghcho)\
**Post date:** [July 24, 2018, 4:12am UTC](https://discuss.elastic.co/t/topic/141287/1 "2018-07-24T04:12:56Z")

</div>

입력 데이터 형태는 다음과 같습니다.

2010/01/01 12:23:11, 1726, 5638, 4873, ...

한개의 날짜 정보(2010/01/01 12:23:11)와 백개의 정수가 각각 콤마로 구분되어 있습니다.

이를 필터링해서 키바나에서 값들을 사용할 수 있게 하려고 하는데, 백개의 정수 값들을 한번에 처리하는 방법을 모르겠습니다. 자세히 말하면, 백개의 정수 각각을 csv필터 column으로 val1,val2,...,val100 와 같은 식으로 나누고 convert에서도 val1 =\> integer, ..., val100 =\> integer 하면 가능하지만, for문과 같은 함수를 이용하여 일괄적으로 처리하고 싶습니다.

방법이 있을까요?

---

<div class="post-metadata">

**Author:** ![kimjmin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimjmin/32/15223_2.png) [@kimjmin](https://discuss.elastic.co/u/kimjmin)\
**Post date:** [July 30, 2018, 5:11am UTC](https://discuss.elastic.co/t/topic/141287/2 "2018-07-30T05:11:54Z")

</div>

일단 ruby 필터를 사용하는 방법이 있습니다.

> [@Iteration in Logstash](https://discuss.elastic.co/t/iteration-in-logstash/26123):
>
> I have a string data in Logstash that has been parsed as that looks like "id": "0,3,10" "value": "100,200,300" I would like to match the individual "id" to the corresponding "value" with respect to their order in the string. I want the field to look like "id0": "100" "id3": "200" "id10": "300" As of now, I have used the mutate field to separate the array into its individual values. I used the following code: mutate { add\_field =\> {"id%{[id][0]}" =\> "%{[value][0]}"} add\_field =\> {"id%…

아니면 split 를 사용해서 저 값들을 한 필드의 배열로 우선 넣어두면 그 배열 필드의 형식을 이용해서 한번에 변경은 가능할겁니다. 그 후에 나누는 방법을 사용하면 어떨까요?

어떤 방법이 공수가 적게 드는지 한번 계산 해 보시고 사용 해 보세요.

---

<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 27, 2018, 5:11am UTC](https://discuss.elastic.co/t/topic/141287/3 "2018-08-27T05:11:58Z")

</div>

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