{"id":76041,"date":"2023-07-31T15:37:58","date_gmt":"2023-07-31T15:37:58","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=76041"},"modified":"2023-07-31T15:37:58","modified_gmt":"2023-07-31T15:37:58","slug":"answer-by-warren-for-splunk-queryspl-replace-a-value-or-anything-that-comes-after-the-value-until-a-special-character","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=76041","title":{"rendered":"Answer by warren for Splunk query(SPL). Replace a value or anything that comes after the value until a special character"},"content":{"rendered":"<p>Use an <a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/eval\" rel=\"nofollow noreferrer\"><code>eval replace()<\/code><\/a><\/p>\n<p>It&#8217;s still regex based, but simpler to understand (and, often, faster to run) than <a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/rex\" rel=\"nofollow noreferrer\"><code>rex mode=sed<\/code><\/a>:<\/p>\n<pre><code>| eval myfield=replace(myfield,&quot;e2_quote_policy_ask_zipcode[^\\\/]+&quot;,&quot;AskZipcode&quot;)\n<\/code><\/pre>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/76784785\/splunk-queryspl-replace-a-value-or-anything-that-comes-after-the-value-until\/76805109#76805109<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use an eval replace() It&#8217;s still regex based, but simpler to understand (and, often, faster to run) than rex mode=sed: | eval myfield=replace(myfield,&quot;e2_quote_policy_ask_zipcode[^\\\/]+&quot;,&quot;AskZipcode&quot;) from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/76784785\/splunk-queryspl-replace-a-value-or-anything-that-comes-after-the-value-until\/76805109#76805109 via IFTTT<\/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-76041","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\/76041","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=76041"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/76041\/revisions"}],"predecessor-version":[{"id":76042,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/76041\/revisions\/76042"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76041"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=76041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}