<?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 How to apply a regular expression that pulls multiple values from application log and show them to the given field name in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-a-regular-expression-that-pulls-multiple-values/m-p/471142#M132547</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I've been struggling to extract certain values from application logs and assign them to the given field name. As I don't know how to use or write regular expression in splunk, I need help to write a query to get the desired output. Here is my base search query:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.myapplication.com/myapi/version5/autofill/" target="_blank"&gt;https://www.myapplication.com/myapi/version5/autofill/&lt;/A&gt; "ERROR"&lt;/P&gt;

&lt;P&gt;here is the output log:&lt;/P&gt;

&lt;P&gt;"ERROR" "store.view.app.api.controller.myClientLoggingController" "viewhost02" "myview2_2" &amp;lt;&amp;gt; "catalina-exec-7" "requestId=d4s6666-9d6e-2c0g-7c20-6e9f7wfa7f6" &amp;lt;&amp;gt; "clientIp=234.234.234.22" "store.view.app.api.controller.myClientLoggingController.logError(?:?):My-AngularApp&lt;BR /&gt;
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxcxxxxxxxxxxxx&lt;/P&gt;

&lt;H2&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/H2&gt;

&lt;P&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; in above log I have replaced the brackets &amp;lt;&amp;gt; with quotes "" &lt;/P&gt;

&lt;P&gt;Now I want to extract the "requestId", "clientIp" and "My-AngularApp" and assign them to field name as  "Req_ID", "Cust_IP" and "App_Name" respectively.&lt;/P&gt;

&lt;P&gt;Can someone please help with the query to achieve the desired output, as I always struggle with REX syntax and can't write the query by my own.&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 05:37:11 GMT</pubDate>
    <dc:creator>iqbalintouch</dc:creator>
    <dc:date>2020-09-30T05:37:11Z</dc:date>
    <item>
      <title>How to apply a regular expression that pulls multiple values from application log and show them to the given field name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-a-regular-expression-that-pulls-multiple-values/m-p/471142#M132547</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I've been struggling to extract certain values from application logs and assign them to the given field name. As I don't know how to use or write regular expression in splunk, I need help to write a query to get the desired output. Here is my base search query:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.myapplication.com/myapi/version5/autofill/" target="_blank"&gt;https://www.myapplication.com/myapi/version5/autofill/&lt;/A&gt; "ERROR"&lt;/P&gt;

&lt;P&gt;here is the output log:&lt;/P&gt;

&lt;P&gt;"ERROR" "store.view.app.api.controller.myClientLoggingController" "viewhost02" "myview2_2" &amp;lt;&amp;gt; "catalina-exec-7" "requestId=d4s6666-9d6e-2c0g-7c20-6e9f7wfa7f6" &amp;lt;&amp;gt; "clientIp=234.234.234.22" "store.view.app.api.controller.myClientLoggingController.logError(?:?):My-AngularApp&lt;BR /&gt;
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxcxxxxxxxxxxxx&lt;/P&gt;

&lt;H2&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/H2&gt;

&lt;P&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; in above log I have replaced the brackets &amp;lt;&amp;gt; with quotes "" &lt;/P&gt;

&lt;P&gt;Now I want to extract the "requestId", "clientIp" and "My-AngularApp" and assign them to field name as  "Req_ID", "Cust_IP" and "App_Name" respectively.&lt;/P&gt;

&lt;P&gt;Can someone please help with the query to achieve the desired output, as I always struggle with REX syntax and can't write the query by my own.&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:37:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-a-regular-expression-that-pulls-multiple-values/m-p/471142#M132547</guid>
      <dc:creator>iqbalintouch</dc:creator>
      <dc:date>2020-09-30T05:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply a regular expression that pulls multiple values from application log and show them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-a-regular-expression-that-pulls-multiple-values/m-p/503606#M140579</link>
      <description>&lt;P&gt;I restored the angle brackets to make it easier for helpers to create a regex for you.&amp;nbsp; Please edit the question to correct any mistakes I may have made.&lt;/P&gt;&lt;P&gt;Are you familiar with &lt;A href="https://regex101.com" target="_self"&gt;regex101.com&lt;/A&gt;?&amp;nbsp; It's a great web site for testing regular expressions.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 16:59:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-a-regular-expression-that-pulls-multiple-values/m-p/503606#M140579</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-06-09T16:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply a regular expression that pulls multiple values from application log and show them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-a-regular-expression-that-pulls-multiple-values/m-p/503628#M140582</link>
      <description>&lt;P&gt;Here's a stab at it. You'll be better served by &lt;EM&gt;not&lt;/EM&gt; substituting elements of your log except to obfuscate sensitive data. I worked with what you have, which means it may not work as-is but this should give you a pattern to follow.&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&amp;lt;(?&amp;lt;log_level&amp;gt;[^&amp;gt;]+)&amp;gt;\s+&amp;lt;(?&amp;lt;class&amp;gt;[^&amp;gt;]+)&amp;gt;\s+&amp;lt;(?&amp;lt;hostname&amp;gt;[^&amp;gt;]+)&amp;gt;\s+&amp;lt;(?&amp;lt;viewname&amp;gt;[^&amp;gt;]+)&amp;gt;\s+&amp;lt;(?&amp;lt;unknown1&amp;gt;[^&amp;gt;].)?&amp;gt;\s+&amp;lt;(?&amp;lt;exec_process&amp;gt;[^&amp;gt;]+)&amp;gt;\s+&amp;lt;requestId=(?&amp;lt;Req_ID&amp;gt;[^&amp;gt;]+)&amp;gt;\s+&amp;lt;(?&amp;lt;unknown2&amp;gt;[^&amp;gt;]+)?&amp;gt;\s+&amp;lt;clientIp=(?&amp;lt;Cust_IP&amp;gt;[^\"]+)\"&amp;gt;\"(?&amp;lt;log_class&amp;gt;[^:].+):(?&amp;lt;App_Name&amp;gt;[^\ ]+)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Regex101 link: &lt;A href="https://regex101.com/r/FX8lkQ/1" target="_blank"&gt;https://regex101.com/r/FX8lkQ/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 20:30:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-a-regular-expression-that-pulls-multiple-values/m-p/503628#M140582</guid>
      <dc:creator>Yorokobi</dc:creator>
      <dc:date>2020-06-09T20:30:47Z</dc:date>
    </item>
  </channel>
</rss>

