# Get 10 characters before substring in logstash?

**URL:** <https://discuss.elastic.co/t/get-10-characters-before-substring-in-logstash/94439>\
**Category:** Logstash\
**Created:** [July 25, 2017, 7:58am UTC](https://discuss.elastic.co/t/get-10-characters-before-substring-in-logstash/94439 "2017-07-25T07:58:45Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [July 25, 2017, 8:11am UTC](https://discuss.elastic.co/t/get-10-characters-before-substring-in-logstash/94439/3 "2017-07-25T08:11:02Z")

</div>

Thanks @R-Ali

But what i want is different i want first 10 characters from a substring in `ERRORTYPE` field where the substring ends with Exception .

EX: "ERRORTYPE" : "The exception name is INDEXNOTFOUNDException"

Then i need to get "ErrorType" : INDEXNOTFOUNDException

Ref: [How do perform string manipulations](https://discuss.elastic.co/t/how-do-perform-string-manipulations/32706/2)

Thanks

---

_[View the full topic](https://discuss.elastic.co/t/get-10-characters-before-substring-in-logstash/94439)._
