<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help on where match and rex field commands in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651571#M225253</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;sorry: my mistake!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt; 
| rex field=ObjectD max_match=0 "OU\\s*=\s*(?&amp;lt;OU&amp;gt;\w+)"
| rex field=ObjectD max_match=0 "DC\s*\=\s*(?&amp;lt;DC&amp;gt;\w+)"
| search (OU=Admin OR OU=Utilisateurs) DC=abc&lt;/LI-CODE&gt;&lt;P&gt;in this way, it takes all values and you can use them for searching.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Sat, 22 Jul 2023 05:54:16 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-07-22T05:54:16Z</dc:date>
    <item>
      <title>Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651328#M225178</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a field called ObjectD which is always different for each events&lt;/P&gt;&lt;P&gt;But in this field, there is always à character chain which begins by OU= and DC=&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;OU=Admin,&amp;nbsp; OU=toto, OU=Utilsateur, DC=abc, DC=def&lt;/P&gt;&lt;P&gt;I need to filter the events where OU=Admin or OU=Utilisateurs and DC=abc&lt;/P&gt;&lt;P&gt;So i am doing this in my search after the stats&lt;/P&gt;&lt;P&gt;| where match(ObjectD,"OU=Admin|OU=Utilisateurs),DC=abc")&lt;/P&gt;&lt;P&gt;But it returns anything&lt;/P&gt;&lt;P&gt;I also need to create a new field with the name of the OU but because the first clause doesnt works the rex command doesnt works too&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my rex&lt;/P&gt;&lt;P&gt;| rex field=ObjectD "^[^=]+=[^=]+=(?&amp;lt;OU&amp;gt;[^,]+)"&lt;/P&gt;&lt;P&gt;Could you help please?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 15:29:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651328#M225178</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-07-20T15:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651330#M225179</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;usually in Splunk a field with the pair fieldname=fieldvalue is extracted, so you should have OU and DC as extracted field.&lt;/P&gt;&lt;P&gt;so why don't you use:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt; (OU=Admin OR OU=Utilisateurs) DC=abc&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 15:39:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651330#M225179</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-20T15:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651333#M225181</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Its not the case&lt;/P&gt;&lt;P&gt;This field are enclosed in the field ObjectD&lt;/P&gt;&lt;P&gt;I have foud a workaround with the where clause but i have an issue with the rex field&lt;/P&gt;&lt;P&gt;For example, if i say that OU in ObjectD is équal to "Utilisateurs" the rex field display the first OU fond and not the OU specified in the where clause!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 15:56:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651333#M225181</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-07-20T15:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651344#M225186</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the field should be extracted automatically, but anyway, you can extract these fields and use them in a search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt; 
| rex field=ObjectD match=0 "OU\\s*=\s*(?&amp;lt;OU&amp;gt;\w+)"
| rex field=ObjectD match=0 "DC\s*\=\s*(?&amp;lt;DC&amp;gt;\w+)"
| search (OU=Admin OR OU=Utilisateurs) DC=abc&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 16:37:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651344#M225186</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-20T16:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651395#M225203</link>
      <description>&lt;P&gt;Thanks Guiseppe but it's not exactly my need&lt;/P&gt;&lt;P&gt;Imagine i need to match these condition in ObjectD field&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| where match(ObjectD,"OU=Admin),DC=abc")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then i need to create a new field called "OU" with the rex field command and in this field the "Admin" OU must display "Admin"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 01:38:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651395#M225203</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-07-21T01:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651409#M225209</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;my solution exacly does what you're requesting:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;it extract OU and DC from objectD&lt;/LI&gt;&lt;LI&gt;then it uses these extracted fields for the filter,&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;but it does in a different way, without format problems&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 05:48:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651409#M225209</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-21T05:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651528#M225238</link>
      <description>&lt;P&gt;I confirm that your rex example extract the field OU&lt;/P&gt;&lt;P&gt;| rex field=ObjectD match=0 "OU\\s*=\s*(?&amp;lt;OU&amp;gt;\w+)"&lt;/P&gt;&lt;P&gt;But I have another problem&lt;/P&gt;&lt;P&gt;The field ObjectDN looks like this&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(OU=Toto,OU=Titi,OU=Admin,DC=abc,DC=efg)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In my where clause, I need to filter events when the condition is true&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example, below, I need to filter the events where OU=Admin&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| where match(ObjectD,"OU=Admin),DC=abc")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So you rex command below extract correctly the OU but it's not the good OU&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;If my field ObjectDN is like this (OU=Toto,OU=Titi,OU=Admin,DC=abc,DC=efg), the OU field extracted is "Toto" while I need to extract "Admin" only because OU=Toto is at the first place in the field ObkectDN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It means that the OU extracted is always the first OU item in the ObjectDN&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If my field to extract the OU "Admin" the ObjectDN field would be this one&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(OU=AdminOU=Titi,OU=Toto,DC=abc,DC=efg)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So is there a way to extract the OU corresponding to the where clause no matter is position in the field ObjectName please?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 17:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651528#M225238</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-07-21T17:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651537#M225242</link>
      <description>&lt;P&gt;If I understand you correctly, you want to extract the last OU in your DN below the DC level, right? That would be something like&lt;/P&gt;&lt;PRE&gt;| rex field=ObjectD "OU\s*=\s*(?&amp;lt;ou&amp;gt;[^=]+)\s*,\s*DC=)"&lt;/PRE&gt;&lt;P&gt;(I added few extra \s* which you might want to get rid of if you're sure they are not needed; I don't remember where the whotespaces in DN can be).&lt;/P&gt;&lt;P&gt;Then you can filter on the ou field's value.&lt;/P&gt;&lt;P&gt;There is one caveat though and I'll let you work it out yurself.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 18:13:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651537#M225242</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-07-21T18:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651568#M225252</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;No&lt;/P&gt;&lt;P&gt;The OU item in ObjectDN field is nver in the same order&lt;/P&gt;&lt;P&gt;For example it can be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ObjectDN=(OU=Admin,OU=toto,OU=Utilsateur,DC=abc,DC=def)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Or&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ObjectDN=(OU=toto,OU=Admin,OU=Utilsateur,DC=abc,DC=def)&lt;/LI-CODE&gt;&lt;P&gt;But when I execute the rex field below, it's always the first item in ObjectDN which is displayed whatever the where condition is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=ObjectD match=0 "OU\\s*=\s*(?&amp;lt;OU&amp;gt;\w+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;So it means that if the ObjectDN is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ObjectDN=(OU=toto,OU=Admin,OU=Utilsateur,DC=abc,DC=def)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;And the where clause is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where match(ObjectD,"OU=Admin),DC=abc")&lt;/LI-CODE&gt;&lt;P&gt;It's the item "toto" dispayed in the field "OU" instead Admin&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 04:19:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651568#M225252</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-07-22T04:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651571#M225253</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;sorry: my mistake!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt; 
| rex field=ObjectD max_match=0 "OU\\s*=\s*(?&amp;lt;OU&amp;gt;\w+)"
| rex field=ObjectD max_match=0 "DC\s*\=\s*(?&amp;lt;DC&amp;gt;\w+)"
| search (OU=Admin OR OU=Utilisateurs) DC=abc&lt;/LI-CODE&gt;&lt;P&gt;in this way, it takes all values and you can use them for searching.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 05:54:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651571#M225253</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-22T05:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651587#M225266</link>
      <description>&lt;P&gt;1. You're referring to either your own regex or &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt; 's, not mine. I specifically anchored mine regex to capture the last OU.&lt;/P&gt;&lt;P&gt;2. As far as I can see, the multi-value regexes include \w+ as the capturing group whereas any identifier at given path level can contain spaces.&lt;/P&gt;&lt;P&gt;3. All those regexes might (and will) fail if the name at given level contains escaped delimiter (and I'm not sure it can't contain "\," sequence)&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 08:19:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651587#M225266</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-07-22T08:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651856#M225327</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;All the OU fields and the CN fields are correctly collected&lt;/P&gt;&lt;P&gt;But the search below do not do the filtering...&lt;/P&gt;&lt;PRE&gt;| search (OU=Admin OR OU=Utilisateurs) DC=abc&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 09:42:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651856#M225327</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-07-25T09:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651862#M225329</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I suppose that you checked also the DC field than the OU.&lt;/P&gt;&lt;P&gt;Anyway, it shouldn't be the issue, but, pleasew try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search (OU="Admin" OR OU="Utilisateurs") DC="abc"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 10:07:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651862#M225329</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-25T10:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651904#M225339</link>
      <description>&lt;P&gt;Obviously thanks...&lt;/P&gt;&lt;P&gt;Last question, is it possible to display in the field OU or the field DC only the field specified in&lt;/P&gt;&lt;PRE&gt;| search (OU="Admin" OR OU="Utilisateurs") DC="abc"&lt;/PRE&gt;&lt;P&gt;Actually in OU i have also&amp;nbsp; displayed Admin2 with Admin and Utilisateurs even if i just search Admin OR Utilisateurs&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 14:30:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651904#M225339</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-07-25T14:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651924#M225343</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you can build your search as you like: you have the OU and DC fields that you can use as you want using all the combinations you like: you have separated fields that you can use.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 14:54:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651924#M225343</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-25T14:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651939#M225351</link>
      <description>&lt;P&gt;Just à little example please?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 15:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651939#M225351</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-07-25T15:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651940#M225352</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;it's a normal search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search (OU="Admin*" OR OU="Utilisateurs") DC="abc"&lt;/LI-CODE&gt;&lt;P&gt;in addition, if you create a field extraction (instead using the rex command) you can use the search in the main search so you have better performances.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 15:51:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651940#M225352</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-25T15:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651960#M225358</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 18:02:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/651960#M225358</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-25T18:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help on where match and rex field commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/652005#M225372</link>
      <description>&lt;P&gt;Well, this solution is only limited to particular types of RDNs.&lt;/P&gt;&lt;P&gt;Since you can have any object classes, I'd try to generalize that parsing. Firstly split all key=value pairs from the DN:&lt;/P&gt;&lt;PRE&gt;|rex field=ObjectDN max_match=0 "(?&amp;lt;kvpair&amp;gt;[a-zA-Z]+\s*=\s*([^,\\\\]|\\\\(?!,)|\\\\,)*),?"&lt;/PRE&gt;&lt;P&gt;(see that it also takes care of possible escaped commas within an object name).&lt;/P&gt;&lt;P&gt;Then remove all excessive spaces around the equals sign so that you can match that consistently.&lt;/P&gt;&lt;PRE&gt;| eval kvpair=mvmap(kvpair,replace(kvpair,"([^=]+?)\s*=\s*(.*)","\1=\2"))&lt;/PRE&gt;&lt;P&gt;Now you can search your pairs&lt;/P&gt;&lt;PRE&gt;| search kvpair="OU=Whatever"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;You could also try to unescape some values (like quotation marks) but I was too lazy for that at the moment &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 06:36:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-where-match-and-rex-field-commands/m-p/652005#M225372</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-07-26T06:36:14Z</dc:date>
    </item>
  </channel>
</rss>

