# Searching for newline or linebreak in a field

**URL:** https://discuss.elastic.co/t/searching-for-newline-or-linebreak-in-a-field/130049
**Category:** Elasticsearch
**Created:** [April 30, 2018, 5:36pm UTC](https://discuss.elastic.co/t/searching-for-newline-or-linebreak-in-a-field/130049 "2018-04-30T17:36:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![DoCoMeffen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/docomeffen/32/22974_2.png) [@DoCoMeffen](https://discuss.elastic.co/u/DoCoMeffen)
#### Post date: [April 30, 2018, 5:36pm UTC](https://discuss.elastic.co/t/searching-for-newline-or-linebreak-in-a-field/130049/1 "2018-04-30T17:36:41Z")

</div>

I (somehow) got some text fields that contain line breaks and/or newlines and I'm having trouble constructing a query to locate these.

I've tried  
"query": {  
"regexp":{  
"user.firstname": "\n"  
}  
}

and  
"query": {  
"wildcard": {  
"user.firstnam": {  
"value": "\n"  
}  
}  
}

It would be nice to locate these records to send in for owner data-cleanup.

I'd appreciate a nudge in the right direction...

-Mike

---

<div class="post-metadata">

### Author: ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)
#### Post date: [May 2, 2018, 2:53am UTC](https://discuss.elastic.co/t/searching-for-newline-or-linebreak-in-a-field/130049/2 "2018-05-02T02:53:52Z")

</div>

What kind of mapping does `user.firstname` have? Is it `keyword`?

---

<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 30, 2018, 2:53am UTC](https://discuss.elastic.co/t/searching-for-newline-or-linebreak-in-a-field/130049/3 "2018-05-30T02:53:55Z")

</div>

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