<?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: Multiple Field extraction using regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691439#M235438</link>
    <description>&lt;P&gt;1. Don't use the "graphical" extractor. It is there for simple cases but for more complicated ones it might not find proper way of extracting fields and if it does it will most probably &lt;EM&gt;not&lt;/EM&gt; be the proper and efficient way to do it.&lt;/P&gt;&lt;P&gt;2. As &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt; already pointed out - this seems to be a json structure. Use proper KV_MODE and don't try to be smart. Fiddling with regexes against structured data usually ends badly.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2024 12:52:47 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-06-24T12:52:47Z</dc:date>
    <item>
      <title>Multiple Field extraction using regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691412#M235426</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;I need to extract the highlighted field in the below messege using regex... I have tried Splunk inbuilt field extraction it is throwing error when i use multiple field...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{ "eventTime": "2024-06-24T06:15:42Z", "leaduuid": "1234455", "CrmId": "&lt;FONT color="#FF0000"&gt;11111111&lt;/FONT&gt;", "studentCrmUuid": "634543564", "externalId": "", "SiteId": "xxxx", "subCategory": "", "category": "Course Enquiry", "eventId": "", "eventRegistrationId": "", "status": "&lt;FONT color="#FF0000"&gt;Open&lt;/FONT&gt;", "source": "&lt;FONT color="#FF0000"&gt;Online Enquiry&lt;/FONT&gt;", "leadId": "&lt;FONT color="#FF0000"&gt;22222222&lt;/FONT&gt;",&amp;nbsp; "assignmentStatusCode": "", "assignmentStatus": "", "isFirstLead": "&lt;FONT color="#FF0000"&gt;yes&lt;/FONT&gt;", "c4cEventId": "", "channelPartnerApplication": "no", "applicationReceivedDate": "", "referredBy": "", "referrerCounsellor": "", "createdBy": "Technical User",&amp;nbsp; "lastChangedBy": "Technical User" , "leadSubAgentID": "", "cancelReason": ""}, "offersInPrinciple": {"offersinPrinciple": "&lt;FONT color="#FF0000"&gt;no&lt;/FONT&gt;", "oipReferenceNumber": "", "oipVerificationStatus": ""}, "qualification": {"qualification": "Unqualified", "primaryFinancialSource": ""}, "online": {"referringUrl": "", "idpNearestOffice": "", "sourceSiteId": "&lt;FONT color="#FF0000"&gt;xxxxx&lt;/FONT&gt;", "preferredCounsellingMode": "", "institutionInfo": "", "courseName": "", "howDidYouHear": "&lt;FONT color="#FF0000"&gt;Social Media&lt;/FONT&gt;"}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 08:48:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691412#M235426</guid>
      <dc:creator>parthiban</dc:creator>
      <dc:date>2024-06-24T08:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Field extraction using regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691413#M235427</link>
      <description>&lt;P&gt;Firstly, this looks like JSON so you should probably look to use JSON extractions. If you are getting errors with this, then perhaps you could share what you tried and what errors you got, and perhaps it can be resolved that way.&lt;/P&gt;&lt;P&gt;However, if you want to continue down the rex track (not recommended), you could try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"CrmId\": \"(?&amp;lt;CrmId&amp;gt;[^\"]+).*\"status\": \"(?&amp;lt;status&amp;gt;[^\"]+).*\"source\": \"(?&amp;lt;source&amp;gt;[^\"]+).*\"leadId\": \"(?&amp;lt;leadId&amp;gt;[^\"]+).*\"isFirstLead\": \"(?&amp;lt;isFirstLead&amp;gt;[^\"]+).*\"offersinPrinciple\": \"(?&amp;lt;offersinPrinciple&amp;gt;[^\"]+).*\"sourceSiteId\": \"(?&amp;lt;sourceSiteId&amp;gt;[^\"]+).*\"howDidYouHear\": \"(?&amp;lt;howDidYouHear&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Jun 2024 09:03:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691413#M235427</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-06-24T09:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Field extraction using regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691416#M235429</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;the below error message I got&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The extraction failed. If you are extracting multiple fields, try removing one or more fields. Start with extractions that are embedded within longer text strings.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 09:16:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691416#M235429</guid>
      <dc:creator>parthiban</dc:creator>
      <dc:date>2024-06-24T09:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Field extraction using regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691423#M235431</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You provided rex is also not working as expected.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 11:20:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691423#M235431</guid>
      <dc:creator>parthiban</dc:creator>
      <dc:date>2024-06-24T11:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Field extraction using regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691439#M235438</link>
      <description>&lt;P&gt;1. Don't use the "graphical" extractor. It is there for simple cases but for more complicated ones it might not find proper way of extracting fields and if it does it will most probably &lt;EM&gt;not&lt;/EM&gt; be the proper and efficient way to do it.&lt;/P&gt;&lt;P&gt;2. As &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt; already pointed out - this seems to be a json structure. Use proper KV_MODE and don't try to be smart. Fiddling with regexes against structured data usually ends badly.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 12:52:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691439#M235438</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-06-24T12:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Field extraction using regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691448#M235443</link>
      <description>&lt;P&gt;Given your sample data, the extraction does work, as shown by this runanywhere example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="{ \"eventTime\": \"2024-06-24T06:15:42Z\", \"leaduuid\": \"1234455\", \"CrmId\": \"11111111\", \"studentCrmUuid\": \"634543564\", \"externalId\": \"\", \"SiteId\": \"xxxx\", \"subCategory\": \"\", \"category\": \"Course Enquiry\", \"eventId\": \"\", \"eventRegistrationId\": \"\", \"status\": \"Open\", \"source\": \"Online Enquiry\", \"leadId\": \"22222222\",  \"assignmentStatusCode\": \"\", \"assignmentStatus\": \"\", \"isFirstLead\": \"yes\", \"c4cEventId\": \"\", \"channelPartnerApplication\": \"no\", \"applicationReceivedDate\": \"\", \"referredBy\": \"\", \"referrerCounsellor\": \"\", \"createdBy\": \"Technical User\",  \"lastChangedBy\": \"Technical User\" , \"leadSubAgentID\": \"\", \"cancelReason\": \"\"}, \"offersInPrinciple\": {\"offersinPrinciple\": \"no\", \"oipReferenceNumber\": \"\", \"oipVerificationStatus\": \"\"}, \"qualification\": {\"qualification\": \"Unqualified\", \"primaryFinancialSource\": \"\"}, \"online\": {\"referringUrl\": \"\", \"idpNearestOffice\": \"\", \"sourceSiteId\": \"xxxxx\", \"preferredCounsellingMode\": \"\", \"institutionInfo\": \"\", \"courseName\": \"\", \"howDidYouHear\": \"Social Media\"}"
| rex "\"CrmId\": \"(?&amp;lt;CrmId&amp;gt;[^\"]+).*\"status\": \"(?&amp;lt;status&amp;gt;[^\"]+).*\"source\": \"(?&amp;lt;source&amp;gt;[^\"]+).*\"leadId\": \"(?&amp;lt;leadId&amp;gt;[^\"]+).*\"isFirstLead\": \"(?&amp;lt;isFirstLead&amp;gt;[^\"]+).*\"offersinPrinciple\": \"(?&amp;lt;offersinPrinciple&amp;gt;[^\"]+).*\"sourceSiteId\": \"(?&amp;lt;sourceSiteId&amp;gt;[^\"]+).*\"howDidYouHear\": \"(?&amp;lt;howDidYouHear&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;&lt;P&gt;Please provide more details on what exactly is "not working", and more examples of your events demonstrating the failure.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 13:25:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691448#M235443</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-06-24T13:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Field extraction using regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691505#M235457</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;I need to extract the highlighted field in the below messege using regex...&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Not only do you not NEED to do this using regex, you MUST NOT use regex for this task. &amp;nbsp;As &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;points out, your data is in JSON, a structured data. &amp;nbsp;Never treat structured data as plain text as &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;points out.&lt;/P&gt;&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;notes, you can set&amp;nbsp;&lt;SPAN&gt;KV_MODE = json in your sourcetype. &amp;nbsp;But even if you do not, Splunk should have already figured out and give you&amp;nbsp;CrmId,&amp;nbsp;status,&amp;nbsp;source, etc. &amp;nbsp;Do you not get these field names and values?&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;field name&lt;/TD&gt;&lt;TD width="182.015625px"&gt;field value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;CrmId&lt;/TD&gt;&lt;TD width="182.015625px"&gt;11111111&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;SiteId&lt;/TD&gt;&lt;TD width="182.015625px"&gt;xxxx&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;applicationReceivedDate&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;assignmentStatus&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;assignmentStatusCode&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;c4cEventId&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;cancelReason&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;category&lt;/TD&gt;&lt;TD width="182.015625px"&gt;Course Enquiry&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;channelPartnerApplication&lt;/TD&gt;&lt;TD width="182.015625px"&gt;no&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;createdBy&lt;/TD&gt;&lt;TD width="182.015625px"&gt;Technical User&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;eventId&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;eventRegistrationId&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;eventTime&lt;/TD&gt;&lt;TD width="182.015625px"&gt;2024-06-24T06:15:42Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;externalId&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;isFirstLead&lt;/TD&gt;&lt;TD width="182.015625px"&gt;yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;lastChangedBy&lt;/TD&gt;&lt;TD width="182.015625px"&gt;Technical User&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;leadId&lt;/TD&gt;&lt;TD width="182.015625px"&gt;22222222&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;leadSubAgentID&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;leaduuid&lt;/TD&gt;&lt;TD width="182.015625px"&gt;1234455&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;referredBy&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;referrerCounsellor&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;source&lt;/TD&gt;&lt;TD width="182.015625px"&gt;Online Enquiry&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;status&lt;/TD&gt;&lt;TD width="182.015625px"&gt;Open&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;studentCrmUuid&lt;/TD&gt;&lt;TD width="182.015625px"&gt;634543564&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="204.390625px"&gt;subCategory&lt;/TD&gt;&lt;TD width="182.015625px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Even if you do not for some oddball reason, using spath should suffice. &amp;nbsp;This is an example with spath using&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;'s makeresults emulation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="{ \"eventTime\": \"2024-06-24T06:15:42Z\", \"leaduuid\": \"1234455\", \"CrmId\": \"11111111\", \"studentCrmUuid\": \"634543564\", \"externalId\": \"\", \"SiteId\": \"xxxx\", \"subCategory\": \"\", \"category\": \"Course Enquiry\", \"eventId\": \"\", \"eventRegistrationId\": \"\", \"status\": \"Open\", \"source\": \"Online Enquiry\", \"leadId\": \"22222222\",  \"assignmentStatusCode\": \"\", \"assignmentStatus\": \"\", \"isFirstLead\": \"yes\", \"c4cEventId\": \"\", \"channelPartnerApplication\": \"no\", \"applicationReceivedDate\": \"\", \"referredBy\": \"\", \"referrerCounsellor\": \"\", \"createdBy\": \"Technical User\",  \"lastChangedBy\": \"Technical User\" , \"leadSubAgentID\": \"\", \"cancelReason\": \"\"}, \"offersInPrinciple\": {\"offersinPrinciple\": \"no\", \"oipReferenceNumber\": \"\", \"oipVerificationStatus\": \"\"}, \"qualification\": {\"qualification\": \"Unqualified\", \"primaryFinancialSource\": \"\"}, \"online\": {\"referringUrl\": \"\", \"idpNearestOffice\": \"\", \"sourceSiteId\": \"xxxxx\", \"preferredCounsellingMode\": \"\", \"institutionInfo\": \"\", \"courseName\": \"\", \"howDidYouHear\": \"Social Media\"}"
``` ITWhisperer's data emulation ```

| spath&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It gives the above field names and values.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 05:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Field-extraction-using-regex/m-p/691505#M235457</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-06-25T05:43:10Z</dc:date>
    </item>
  </channel>
</rss>

