Splunk Cloud Platform

Extract value from a field

verifi81
Path Finder

Hello folks

I have a search in which I table.  Here is a snippet of the results

 

ObjectDN _time

cn=Jane Fonda,OU=Blue,OU=Pad,OU=Circle Team,DC=circle,DC=net2021-04-22 23:48:36CN=Matt Cruz,OU=Blue,OU=Pad2,OU=Circle Team,DC=circle,DC=net2021-04-22 01:07:43

 

If I want to extract the names contained in the CN to output to a column on it's own how would I do that?

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| rex field=ObjectDN "(?i)CN=(?<NAMES>[^,]+)"

View solution in original post

0 Karma

verifi81
Path Finder

Perfect. thank you so much.

0 Karma

verifi81
Path Finder

I don't know why the question cut off.  My question is, if I wanted just the CN portion of the results to display in a separate column called "NAMES", how can I do that?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex field=ObjectDN "CN=(?<NAMES>[^,]+)"
0 Karma

verifi81
Path Finder

ITWhisperer, thank you so much.

 

In some cases the CN is lower case so it doesn't match for those entries.  Is there a way to make this case insensitive?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex field=ObjectDN "(?i)CN=(?<NAMES>[^,]+)"
0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...