<?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 match start of field string using regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-start-of-field-string-using-regex/m-p/632118#M219568</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254196"&gt;@mhulse&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;regex command works on _raw as a default. You need to tell the field like below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xyz source=xyz 
| spath "httpRequest.headers{}.value"
| search "httpRequest.headers{}.value"="application/json"
| spath "httpRequest.uri"
| regex "httpRequest.uri"="^/public.*"
| stats count by "httpRequest.uri"
| sort -count &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Feb 2023 03:18:18 GMT</pubDate>
    <dc:creator>scelikok</dc:creator>
    <dc:date>2023-02-24T03:18:18Z</dc:date>
    <item>
      <title>How to match start of field string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-start-of-field-string-using-regex/m-p/632115#M219567</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to match the start of a path in &lt;STRONG&gt;httpRequest.uri&lt;/STRONG&gt;, as seen here:&lt;/P&gt;&lt;PRE&gt;index=xyz source=xyz &lt;BR /&gt;| spath "httpRequest.headers{}.value"&lt;BR /&gt;| search "httpRequest.headers{}.value"="application/json"&lt;BR /&gt;| spath "httpRequest.uri"&lt;BR /&gt;| regex "^/public*"&lt;BR /&gt;| stats count by "httpRequest.uri"&lt;BR /&gt;| sort -count&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;Unfortunately, it isn't working.&lt;/P&gt;&lt;P&gt;Can someone point out what I am doing wrong here?&lt;/P&gt;&lt;P&gt;If I get rid of the caret, the regex works, but it matches anywhere within the field’s string value. I need to start from the beginning of the string.&lt;/P&gt;&lt;P&gt;Thank you so much in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 03:05:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-start-of-field-string-using-regex/m-p/632115#M219567</guid>
      <dc:creator>mhulse</dc:creator>
      <dc:date>2023-02-24T03:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to match start of field string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-start-of-field-string-using-regex/m-p/632118#M219568</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254196"&gt;@mhulse&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;regex command works on _raw as a default. You need to tell the field like below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xyz source=xyz 
| spath "httpRequest.headers{}.value"
| search "httpRequest.headers{}.value"="application/json"
| spath "httpRequest.uri"
| regex "httpRequest.uri"="^/public.*"
| stats count by "httpRequest.uri"
| sort -count &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 03:18:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-start-of-field-string-using-regex/m-p/632118#M219568</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2023-02-24T03:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to match start of field string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-start-of-field-string-using-regex/m-p/632121#M219569</link>
      <description>&lt;P&gt;Thank you so much &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;!!! I greatly appreciate your help! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 03:34:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-start-of-field-string-using-regex/m-p/632121#M219569</guid>
      <dc:creator>mhulse</dc:creator>
      <dc:date>2023-02-24T03:34:07Z</dc:date>
    </item>
  </channel>
</rss>

