<?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: How to extract using rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-using-rex/m-p/661067#M228239</link>
    <description>&lt;P&gt;The values OP is seeking is in the field message. (From the illustration in OP, the event is JSON - but it is best to illustrate with raw text, not a copy from Splunk's formatted event view.) &amp;nbsp;So&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=message "Received update request (?&amp;lt;IL_Customer&amp;gt;[^\.]+)\. Size of array: (?&amp;lt;ArraySize&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;(Also slightly more efficient because the regex engine would be scanning smaller strings.)&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2023 17:23:49 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2023-10-17T17:23:49Z</dc:date>
    <item>
      <title>How to extract using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-using-rex/m-p/661036#M228230</link>
      <description>&lt;P&gt;&lt;SPAN&gt;{&amp;nbsp;&lt;/SPAN&gt;&lt;A title="Original URL: https://splunkeu.bmwgroup.net/en-US/app/search/search?q=search%20index%3Dwhcrm%20%0A(sourcetype%3Dbmw-crm-wh-xl-esocrm-prd-api(%22Request%20received%20from%20esocrm%22%20OR%20%22Received%20C2C%20events%20from%20Topic%22))%20OR%20(sourcetype%3Dbmw-sl-sfdc-prd-api(%22Received%20update%20request%20IL_Customer%22%20OR%20%22Received%20update%20request%20IL_Customer_To_Customer%22%20OR%20%22Received%20update%20request%20IL_Vehicle_OKU_Relation%22))%0Ad22d16aa-7f4e-4356-91b0-060240938e17f13139fd-8785-4d8b-869c-c3898c70c0d9%20OR%20fc1b51e0-6cea-11ee-a910-02790e559a7d%20OR%204b910aaf-d316-4594-8eda-c56e861499d3%20OR%204d859480-6ce3-11ee-a910-02790e559a7d&amp;amp;display.page.search.mode=smart&amp;amp;dispatch.sample_ratio=1&amp;amp;earliest=-24h%40h&amp;amp;latest=now&amp;amp;display.page.search.showFields=1&amp;amp;display.events.fields=%5B%22host%22%2C%22source%22%2C%22sourcetype%22%2C%22eventtype%22%5D&amp;amp;sid=1697547454.911639_A1AACC25-F417-4F61-B253-89557D014363. Click or tap if you trust this link." href="https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsplunkeu.bmwgroup.net%2Fen-US%2Fapp%2Fsearch%2Fsearch%3Fq%3Dsearch%2520index%253Dwhcrm%2520%250A(sourcetype%253Dbmw-crm-wh-xl-esocrm-prd-api(%2522Request%2520received%2520from%2520esocrm%2522%2520OR%2520%2522Received%2520C2C%2520events%2520from%2520Topic%2522))%2520OR%2520(sourcetype%253Dbmw-sl-sfdc-prd-api(%2522Received%2520update%2520request%2520IL_Customer%2522%2520OR%2520%2522Received%2520update%2520request%2520IL_Customer_To_Customer%2522%2520OR%2520%2522Received%2520update%2520request%2520IL_Vehicle_OKU_Relation%2522))%250Ad22d16aa-7f4e-4356-91b0-060240938e17f13139fd-8785-4d8b-869c-c3898c70c0d9%2520OR%2520fc1b51e0-6cea-11ee-a910-02790e559a7d%2520OR%25204b910aaf-d316-4594-8eda-c56e861499d3%2520OR%25204d859480-6ce3-11ee-a910-02790e559a7d%26display.page.search.mode%3Dsmart%26dispatch.sample_ratio%3D1%26earliest%3D-24h%2540h%26latest%3Dnow%26display.page.search.showFields%3D1%26display.events.fields%3D%255B%2522host%2522%252C%2522source%2522%252C%2522sourcetype%2522%252C%2522eventtype%2522%255D%26sid%3D1697547454.911639_A1AACC25-F417-4F61-B253-89557D014363&amp;amp;data=05%7C01%7CAwarshika.Kushwaha%40cognizant.com%7Cbc252b3a3cdf4eb7274508dbcf235624%7Cde08c40719b9427d9fe8edf254300ca7%7C0%7C0%7C638331522931243148%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=HcpDDqRHirsWgTqaSyzOeXwBp1uZRsTO0JnPMzsLkbY%3D&amp;amp;reserved=0" target="_blank" rel="noopener noreferrer"&gt;&lt;SPAN&gt;[-]&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;&lt;SPAN&gt;logger&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;org.mule.runtime.core.internal.processor.LoggerMessageProcessor&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;&lt;SPAN&gt;message&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Received update request &lt;STRONG&gt;IL_Customer&lt;/STRONG&gt;. Size of array: &lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;&lt;SPAN&gt;properties&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;:&amp;nbsp;{&amp;nbsp;&lt;A title="Original URL: https://splunkeu.bmwgroup.net/en-US/app/search/search?q=search%20index%3Dwhcrm%20%0A(sourcetype%3Dbmw-crm-wh-xl-esocrm-prd-api(%22Request%20received%20from%20esocrm%22%20OR%20%22Received%20C2C%20events%20from%20Topic%22))%20OR%20(sourcetype%3Dbmw-sl-sfdc-prd-api(%22Received%20update%20request%20IL_Customer%22%20OR%20%22Received%20update%20request%20IL_Customer_To_Customer%22%20OR%20%22Received%20update%20request%20IL_Vehicle_OKU_Relation%22))%0Ad22d16aa-7f4e-4356-91b0-060240938e17f13139fd-8785-4d8b-869c-c3898c70c0d9%20OR%20fc1b51e0-6cea-11ee-a910-02790e559a7d%20OR%204b910aaf-d316-4594-8eda-c56e861499d3%20OR%204d859480-6ce3-11ee-a910-02790e559a7d&amp;amp;display.page.search.mode=smart&amp;amp;dispatch.sample_ratio=1&amp;amp;earliest=-24h%40h&amp;amp;latest=now&amp;amp;display.page.search.showFields=1&amp;amp;display.events.fields=%5B%22host%22%2C%22source%22%2C%22sourcetype%22%2C%22eventtype%22%5D&amp;amp;sid=1697547454.911639_A1AACC25-F417-4F61-B253-89557D014363. Click or tap if you trust this link." href="https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsplunkeu.bmwgroup.net%2Fen-US%2Fapp%2Fsearch%2Fsearch%3Fq%3Dsearch%2520index%253Dwhcrm%2520%250A(sourcetype%253Dbmw-crm-wh-xl-esocrm-prd-api(%2522Request%2520received%2520from%2520esocrm%2522%2520OR%2520%2522Received%2520C2C%2520events%2520from%2520Topic%2522))%2520OR%2520(sourcetype%253Dbmw-sl-sfdc-prd-api(%2522Received%2520update%2520request%2520IL_Customer%2522%2520OR%2520%2522Received%2520update%2520request%2520IL_Customer_To_Customer%2522%2520OR%2520%2522Received%2520update%2520request%2520IL_Vehicle_OKU_Relation%2522))%250Ad22d16aa-7f4e-4356-91b0-060240938e17f13139fd-8785-4d8b-869c-c3898c70c0d9%2520OR%2520fc1b51e0-6cea-11ee-a910-02790e559a7d%2520OR%25204b910aaf-d316-4594-8eda-c56e861499d3%2520OR%25204d859480-6ce3-11ee-a910-02790e559a7d%26display.page.search.mode%3Dsmart%26dispatch.sample_ratio%3D1%26earliest%3D-24h%2540h%26latest%3Dnow%26display.page.search.showFields%3D1%26display.events.fields%3D%255B%2522host%2522%252C%2522source%2522%252C%2522sourcetype%2522%252C%2522eventtype%2522%255D%26sid%3D1697547454.911639_A1AACC25-F417-4F61-B253-89557D014363&amp;amp;data=05%7C01%7CAwarshika.Kushwaha%40cognizant.com%7Cbc252b3a3cdf4eb7274508dbcf235624%7Cde08c40719b9427d9fe8edf254300ca7%7C0%7C0%7C638331522931243148%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=HcpDDqRHirsWgTqaSyzOeXwBp1uZRsTO0JnPMzsLkbY%3D&amp;amp;reserved=0" target="_blank" rel="noopener noreferrer"&gt;[-]&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;&lt;SPAN&gt;correlationId&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;4b910aaf-d316-4594-8eda-c56e861499d3&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I want to extract the IL_customer and array size from the above log. What will be the regular expression.&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 15:17:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-using-rex/m-p/661036#M228230</guid>
      <dc:creator>avi7326</dc:creator>
      <dc:date>2023-10-17T15:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-using-rex/m-p/661039#M228231</link>
      <description>&lt;P&gt;There's probably a JSON-ic way to do that (assuming the event is pure JSON), but &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; can handle a few fields nicely.&lt;/P&gt;&lt;P&gt;Assuming the order of fields is fixed, this regex should do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "Received update request (?&amp;lt;IL_Customer&amp;gt;[^\.]+)\. Size of array: (?&amp;lt;ArraySize&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 15:40:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-using-rex/m-p/661039#M228231</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-10-17T15:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-using-rex/m-p/661067#M228239</link>
      <description>&lt;P&gt;The values OP is seeking is in the field message. (From the illustration in OP, the event is JSON - but it is best to illustrate with raw text, not a copy from Splunk's formatted event view.) &amp;nbsp;So&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=message "Received update request (?&amp;lt;IL_Customer&amp;gt;[^\.]+)\. Size of array: (?&amp;lt;ArraySize&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;(Also slightly more efficient because the regex engine would be scanning smaller strings.)&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 17:23:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-using-rex/m-p/661067#M228239</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-10-17T17:23:49Z</dc:date>
    </item>
  </channel>
</rss>

