{"id":61276,"date":"2022-08-01T15:12:08","date_gmt":"2022-08-01T15:12:08","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=61276"},"modified":"2022-08-01T15:12:08","modified_gmt":"2022-08-01T15:12:08","slug":"answer-by-warren-for-parsing-last-part-of-url-in-splunk","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=61276","title":{"rendered":"Answer by warren for Parsing last part of URL in Splunk"},"content":{"rendered":"<p>This <a href=\"https:\/\/regex101.com\/r\/cjAJTi\/1\" rel=\"nofollow noreferrer\">regular expression<\/a> will match the last part of the URL that ends with (case-insensitive) &quot;exe&quot;, and that ends the string:<\/p>\n<pre><code>| rex field=URL_Field &quot;\\\/(?&lt;exename&gt;[^\\\/]+[eExXeE]{3})$&quot;\n<\/code><\/pre>\n<p>THe format is this: start with a front slash, then match everything that&#8217;s <em>not<\/em> a front slash that ends with &quot;exe&quot;,&quot;EXE&quot;, etc, and that is at the end of the string in question<\/p>\n<p>As you mentioned in a <a href=\"https:\/\/stackoverflow.com\/questions\/73170217\/parsing-last-part-of-url-in-splunk\/73195821#comment129227697_73170428\">comment<\/a> to another <a href=\"https:\/\/stackoverflow.com\/a\/73170428\/4418\">answer<\/a>, using <code>split()<\/code> can also be a good option (sometimes it&#8217;s faster to break a URL with <code>split()<\/code> &#8230; so long as you <em><strong>know<\/strong><\/em> which element in the multivalue field you need<\/p>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/73170217\/parsing-last-part-of-url-in-splunk\/73195821#73195821<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This regular expression will match the last part of the URL that ends with (case-insensitive) &quot;exe&quot;, and that ends the string: | rex field=URL_Field &quot;\\\/(?&lt;exename&gt;[^\\\/]+[eExXeE]{3})$&quot; THe format is this: start with a front slash, then match everything that&#8217;s not a front slash that ends with &quot;exe&quot;,&quot;EXE&quot;, etc, and that is at the end of the &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=61276\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for Parsing last part of URL in Splunk<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[991],"keyring_services":[],"class_list":["post-61276","post","type-post","status-publish","format-standard","hentry","category-blih","tag-stackexchange"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/61276","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61276"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/61276\/revisions"}],"predecessor-version":[{"id":61277,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/61276\/revisions\/61277"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61276"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=61276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}