- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
paulalbert11
Explorer
02-02-2017
01:17 PM
I'm trying to replicate other threads that show how to replace line breaks with delimiters. This search is not working.
| ldapsearch domain=ED search="(&(objectClass=eduPerson)(weillCornellEduCWID=paa2013))" attrs="weillCornellEduCWID,o"
| eval o1 = replace (o, "[\\n\\r]+","|")
| eval o2 = replace (o, "[\n\r]","|")
| table weillCornellEduCWID, o, o1, o2
Any ideas? See screenshot below..
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

vasanthmss
Motivator
02-02-2017
02:19 PM
try something like this,
your base search.... | eval o1=o |nomv o1 | rex mode=sed field=o1 "s/\n/|/g"
V
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

vasanthmss
Motivator
02-02-2017
02:19 PM
try something like this,
your base search.... | eval o1=o |nomv o1 | rex mode=sed field=o1 "s/\n/|/g"
V
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
plimpach
Explorer
06-05-2019
06:55 AM
does exactly what I needed, and much simpler
than the replace function I was trying to get to work.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
paulalbert11
Explorer
02-02-2017
03:03 PM
It works like a charm. Thanks!
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

somesoni2
Revered Legend
02-02-2017
01:26 PM
Does this work?
| ldapsearch domain=ED search="(&(objectClass=eduPerson)(weillCornellEduCWID=paa2013))" attrs="weillCornellEduCWID,o"
| eval o1 = replace (o, "[\r\n]+","|")
| eval o2 = replace (o, "\n","|")
| table weillCornellEduCWID, o, o1, o2
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
paulalbert11
Explorer
02-02-2017
01:59 PM
Thanks for your response, somesoni2. Unfortunately, no. When I run the query, I just get blanks in the o1 and o2 fields.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

somesoni2
Revered Legend
02-02-2017
02:14 PM
So, if I'm not wrong, the field o is a multivalued field and you just want to make it linear with delimiter as pipe. Is that correct?
If that is correct, what do you get when you run this?
| ldapsearch domain=ED search="(&(objectClass=eduPerson)(weillCornellEduCWID=paa2013))" attrs="weillCornellEduCWID,o"
| eval o1 =o | nomv o1
Also, give this a try
| ldapsearch domain=ED search="(&(objectClass=eduPerson)(weillCornellEduCWID=paa2013))" attrs="weillCornellEduCWID,o"
| eventstats values(o) as o1 delim="|" | nomv o1
