# Logstash pipeline configuration. Can someone please hep me? Thank you

**URL:** <https://discuss.elastic.co/t/logstash-pipeline-configuration-can-someone-please-hep-me-thank-you/301891>\
**Category:** Logstash\
**Created:** [April 7, 2022, 3:33pm UTC](https://discuss.elastic.co/t/logstash-pipeline-configuration-can-someone-please-hep-me-thank-you/301891 "2022-04-07T15:33:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sazeens1](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@sazeens1](https://discuss.elastic.co/u/sazeens1)\
**Post date:** [April 7, 2022, 3:33pm UTC](https://discuss.elastic.co/t/logstash-pipeline-configuration-can-someone-please-hep-me-thank-you/301891/1 "2022-04-07T15:33:05Z")

</div>

Hello Everyone, Can someone please help me on this one?

data in the kafka topic test sample:  
{  
"id": "2001",  
"name": "XYZ",  
"address" : "safwq",  
"phone": "1656161"  
}

# Sample Logstash configuration for creating a simple

input {  
kafka {   
bootstrap\_servers =\> "localhost:9092"  
group\_id =\> "test-consumer-group"  
topics =\> ["test"]  
auto\_offset\_reset =\> "earliest"  
codec =\> json   
}  
}  
filter {

}  
output {  
stdout { codec =\> rubydebug }  
elasticsearch {  
hosts =\> ["localhost:9200"]  
codec =\> json  
index =\> "sample-%{[id]}-%{+MM.YYYY}"  
}  
}

Here I'm trying to create a logstash pipeline, I'm able to do it but now I wanted to add a filter:  
i.e the total length of the id should be 10. and if it is not 10 then i need to add leading zeroes.  
For aboove sample:  
output of the index should be like :

sample-0000002001-04.2022

if the id is 1 then it should be

sample-0000000001-04.2022

the length of id can be equal to 10 or less than 10.

---

<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:** [May 5, 2022, 3:33pm UTC](https://discuss.elastic.co/t/logstash-pipeline-configuration-can-someone-please-hep-me-thank-you/301891/2 "2022-05-05T15:33:30Z")

</div>

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