# Custom grok pattern failure with forwardslashes

**URL:** <https://discuss.elastic.co/t/custom-grok-pattern-failure-with-forwardslashes/115409>\
**Category:** Logstash\
**Created:** [January 13, 2018, 3:25pm UTC](https://discuss.elastic.co/t/custom-grok-pattern-failure-with-forwardslashes/115409 "2018-01-13T15:25:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![prophoto](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@prophoto](https://discuss.elastic.co/u/prophoto)\
**Post date:** [January 13, 2018, 3:25pm UTC](https://discuss.elastic.co/t/custom-grok-pattern-failure-with-forwardslashes/115409/1 "2018-01-13T15:25:08Z")

</div>

About 1/400 log entries I'm feeding logstash will have a forwardslash "/" in it. How do I account for that and prevent a grok failure?

---

<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:** [January 16, 2018, 11:10am UTC](https://discuss.elastic.co/t/custom-grok-pattern-failure-with-forwardslashes/115409/2 "2018-01-16T11:10:46Z")

</div>

That obviously depends on the data and the grok expression you use.

---

<div class="post-metadata">

**Author:** ![prophoto](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@prophoto](https://discuss.elastic.co/u/prophoto)\
**Post date:** [January 27, 2018, 6:01pm UTC](https://discuss.elastic.co/t/custom-grok-pattern-failure-with-forwardslashes/115409/3 "2018-01-27T18:01:34Z")

</div>

Field is being matched with %{DATA:incident\_type}. Most are plain text, but some of the data has a forwardslash.

Examples:  
THIS INCIDENT TYPE  
THAT INCIDENT TYPE  
ANOTHER INCIDENT TYPE  
THIS/THAT INCIDENT TYPE \<--doesn't match and throws grok failure.

---

<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:** [January 28, 2018, 9:46pm UTC](https://discuss.elastic.co/t/custom-grok-pattern-failure-with-forwardslashes/115409/4 "2018-01-28T21:46:19Z")

</div>

DATA matches forward slashes. What does the full grok expression and a complete line of input look like?

---

<div class="post-metadata">

**Author:** ![prophoto](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@prophoto](https://discuss.elastic.co/u/prophoto)\
**Post date:** [January 31, 2018, 10:59pm UTC](https://discuss.elastic.co/t/custom-grok-pattern-failure-with-forwardslashes/115409/6 "2018-01-31T22:59:28Z")

</div>

I found the problem, not related to slashes. Content was changed on the server side. I was using BASE10NUM for a field in the grok pattern the content now possibly includes characters and numbers. I switched it to DATA and all is well. Thanks!

---

<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:** [February 28, 2018, 11:00pm UTC](https://discuss.elastic.co/t/custom-grok-pattern-failure-with-forwardslashes/115409/7 "2018-02-28T23:00:24Z")

</div>

Closed on February 28, 2018, 11:00pm UTC

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