<?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: Splunk Fields Extraction in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Fields-Extraction/m-p/745044#M11903</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309365"&gt;@kunalsingh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use a REPORT transform in props.conf and transforms.conf to define the field extractions based on your delimiters.&lt;/P&gt;&lt;PRE&gt;==props.conf==&lt;BR /&gt;[your_sourcetype]
# Replace your_sourcetype with the actual sourcetype of your data
REPORT-kv_pairs = extract_custom_kv&lt;BR /&gt;&lt;BR /&gt;==transforms.conf==&lt;BR /&gt;[extract_custom_kv]
REGEX = ([^=\^]+)=([^\^]*)
FORMAT = $1::$2
MV_ADD = true&lt;/PRE&gt;&lt;P&gt;This configuration defines a field extraction named extract_custom_kv.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;REGEX = ([^=\^]+)=([^\^]*): This regular expression finds key-value pairs separated by =.&lt;/LI&gt;&lt;LI&gt;([^=\^]+) captures the key (any character except = or ^).&lt;/LI&gt;&lt;LI&gt;= matches the literal equals sign.&lt;/LI&gt;&lt;LI&gt;([^\^]*) captures the value (any character except ^, including an empty string). This correctly handles fields like documentName= where the value is empty.&lt;/LI&gt;&lt;LI&gt;FORMAT = $1::$2: This assigns the captured key (group 1) and value (group 2) to a Splunk field.&lt;/LI&gt;&lt;LI&gt;MV_ADD = true: Ensures that if multiple key-value pairs are found in a single event, they are all extracted.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Check a working example at&amp;nbsp;&lt;A href="https://regex101.com/r/yAjRVa/1" target="_blank" rel="noopener"&gt;https://regex101.com/r/yAjRVa/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This method correctly identifies the ^ character as the delimiter between pairs and = as the separator within a pair, handling empty values appropriately. The regex you provided, ^([^=]+)=([^^\&lt;EM&gt;]&lt;/EM&gt;), likely failed because the ^ anchor restricts it to the start of the string, and the character class [^^\*] might not behave as expected compared to [^\^].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt; &lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt; If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 26 Apr 2025 21:13:32 GMT</pubDate>
    <dc:creator>livehybrid</dc:creator>
    <dc:date>2025-04-26T21:13:32Z</dc:date>
    <item>
      <title>Splunk Fields Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Fields-Extraction/m-p/744894#M11901</link>
      <description>&lt;P&gt;I have used this regex -&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;\^&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;^&lt;/SPAN&gt;=&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;+&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;=&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;^&lt;/SPAN&gt;^&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;*&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;Apr 23 21:43:22 3.111.9.101 CEF:0|Seqrite|EPS|5.2.1.0|Data Loss Prevention Event|^|channelType=Applications/Online Services^domainName=AVOTRIXLABS^endpointName=ALEI5-ANURAGR^groupName=Default^channelDetail=Microsoft OneDrive Client^documentName=^filePath=C:\Users\anurag.rathore.AVOTRIXLABS\OneDrive - Scanlytics Technology\Documents\git\splunk_prod\deployment-apps\Fleet_Management_Dashboard\appserver\static\fontawesome-free-6.1.1-web\svgs\solid\flask-vial.svg^macID1=9C-5A-44-0A-26-5B^status=Success^subject=^actionId=Skipped^printerName=^recipientList=^serverDateTime=Wed Apr 23 16:13:57 UTC 2025^matchedItem=Visa^sender=^contentType=Confidential Data^dataId=Client Application^incidentOn=Wed Apr 23 16:07:38 UTC 2025^ipAddressFromClient=***.***.*.16^macID2=00-FF-58-34-31-0E^macID3=B0-FC-36-CA-1C-73^userName=anurag.rathore&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;it is able to extract all field correctly Except a few fields .&lt;BR /&gt;Here documentName should be empty but it is showing this on search time.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 586px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38730i461A916C88519487/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 10:46:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-Fields-Extraction/m-p/744894#M11901</guid>
      <dc:creator>kunalsingh</dc:creator>
      <dc:date>2025-04-24T10:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Fields Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Fields-Extraction/m-p/745039#M11902</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309365"&gt;@kunalsingh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\^([^\=]+)=([^\^]*)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 26 Apr 2025 16:21:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-Fields-Extraction/m-p/745039#M11902</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-04-26T16:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Fields Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Fields-Extraction/m-p/745044#M11903</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309365"&gt;@kunalsingh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use a REPORT transform in props.conf and transforms.conf to define the field extractions based on your delimiters.&lt;/P&gt;&lt;PRE&gt;==props.conf==&lt;BR /&gt;[your_sourcetype]
# Replace your_sourcetype with the actual sourcetype of your data
REPORT-kv_pairs = extract_custom_kv&lt;BR /&gt;&lt;BR /&gt;==transforms.conf==&lt;BR /&gt;[extract_custom_kv]
REGEX = ([^=\^]+)=([^\^]*)
FORMAT = $1::$2
MV_ADD = true&lt;/PRE&gt;&lt;P&gt;This configuration defines a field extraction named extract_custom_kv.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;REGEX = ([^=\^]+)=([^\^]*): This regular expression finds key-value pairs separated by =.&lt;/LI&gt;&lt;LI&gt;([^=\^]+) captures the key (any character except = or ^).&lt;/LI&gt;&lt;LI&gt;= matches the literal equals sign.&lt;/LI&gt;&lt;LI&gt;([^\^]*) captures the value (any character except ^, including an empty string). This correctly handles fields like documentName= where the value is empty.&lt;/LI&gt;&lt;LI&gt;FORMAT = $1::$2: This assigns the captured key (group 1) and value (group 2) to a Splunk field.&lt;/LI&gt;&lt;LI&gt;MV_ADD = true: Ensures that if multiple key-value pairs are found in a single event, they are all extracted.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Check a working example at&amp;nbsp;&lt;A href="https://regex101.com/r/yAjRVa/1" target="_blank" rel="noopener"&gt;https://regex101.com/r/yAjRVa/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This method correctly identifies the ^ character as the delimiter between pairs and = as the separator within a pair, handling empty values appropriately. The regex you provided, ^([^=]+)=([^^\&lt;EM&gt;]&lt;/EM&gt;), likely failed because the ^ anchor restricts it to the start of the string, and the character class [^^\*] might not behave as expected compared to [^\^].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt; &lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt; If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 26 Apr 2025 21:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-Fields-Extraction/m-p/745044#M11903</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-04-26T21:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Fields Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Fields-Extraction/m-p/745047#M11904</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309365"&gt;@kunalsingh&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>Sun, 27 Apr 2025 07:41:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-Fields-Extraction/m-p/745047#M11904</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-04-27T07:41:34Z</dc:date>
    </item>
  </channel>
</rss>

