<?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: Extract multiple groups (rex), key/value pairs comma separated in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-groups-rex-key-value-pairs-comma-separated/m-p/666287#M228569</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/160850"&gt;@ejwade&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you should already have these extractions because usually Splunk identifies the groups fieldname=fieldvalue.&lt;/P&gt;&lt;P&gt;Anyway, please try this regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;name\=\"(?&amp;lt;name&amp;gt;[^\"]*)\",value\=\[*\"(?&amp;lt;values&amp;gt;[^\"]*)&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/PEszES/1" target="_blank"&gt;https://regex101.com/r/PEszES/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2023 06:27:19 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-10-26T06:27:19Z</dc:date>
    <item>
      <title>Extract multiple groups (rex), key/value pairs comma separated</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-groups-rex-key-value-pairs-comma-separated/m-p/666279#M228567</link>
      <description>&lt;P&gt;I'm looking for the regular expression wizards out there. I need to do a rex with two capture groups: one for name, and one for value. I plan to use the replace function, and throw everything else away but those two capture groups (e.g., "\1: \2").&lt;/P&gt;&lt;P&gt;Here are some sample events.&lt;/P&gt;&lt;P&gt;name="Building",value="Southwest",descendants_action="success",operation="OVERRIDE"&lt;BR /&gt;name="Building",value=["Northeast","Northwest"],descendants_action="failure",operation="OVERRIDE"&lt;BR /&gt;name="Building",value="Southeast",descendants_action="success",operation="OVERRIDE"&lt;BR /&gt;name="Building",value="Northwest"&lt;BR /&gt;name="Building",value="Northwest",operation="OVERRIDE"&lt;/P&gt;&lt;P&gt;So far I just have this.&lt;BR /&gt;^name=\"(.*)\",value=\[?(.*)\]?&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 03:37:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-groups-rex-key-value-pairs-comma-separated/m-p/666279#M228567</guid>
      <dc:creator>ejwade</dc:creator>
      <dc:date>2023-10-26T03:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple groups (rex), key/value pairs comma separated</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-groups-rex-key-value-pairs-comma-separated/m-p/666287#M228569</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/160850"&gt;@ejwade&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you should already have these extractions because usually Splunk identifies the groups fieldname=fieldvalue.&lt;/P&gt;&lt;P&gt;Anyway, please try this regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;name\=\"(?&amp;lt;name&amp;gt;[^\"]*)\",value\=\[*\"(?&amp;lt;values&amp;gt;[^\"]*)&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/PEszES/1" target="_blank"&gt;https://regex101.com/r/PEszES/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 06:27:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-groups-rex-key-value-pairs-comma-separated/m-p/666287#M228569</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-10-26T06:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple groups (rex), key/value pairs comma separated</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-groups-rex-key-value-pairs-comma-separated/m-p/666317#M228584</link>
      <description>&lt;P&gt;Try something along these lines&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;^name=\"([^\"]*)\",value=(\[([^\]]+)\]|\"[^\"]+\")(.*)&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://regex101.com/r/id6m8s/1" target="_blank"&gt;https://regex101.com/r/id6m8s/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 09:41:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-groups-rex-key-value-pairs-comma-separated/m-p/666317#M228584</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-10-26T09:41:05Z</dc:date>
    </item>
  </channel>
</rss>

