{"id":75543,"date":"2023-07-14T13:13:28","date_gmt":"2023-07-14T13:13:28","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=75543"},"modified":"2023-07-14T13:13:28","modified_gmt":"2023-07-14T13:13:28","slug":"answer-by-warren-for-alternative-to-30-rex-fieldpath-modesed-in-order-to-replace-path-parameters-in-urls","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=75543","title":{"rendered":"Answer by warren for Alternative to 30+ `| rex field=path mode=sed&#8230;` in order to replace path parameters in urls"},"content":{"rendered":"<p>this sounds like a job for <a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/Admin\/Transformsconf\" rel=\"nofollow noreferrer\"><code>transforms.conf<\/code><\/a> or maybe just to properly extract all those fields with <a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/Admin\/Propssconf\" rel=\"nofollow noreferrer\"><code>props.conf<\/code><\/a>.<\/p>\n<p>If you&#8217;re waiting until search time to mask data, you&#8217;re still <em>storing<\/em> all of what you&#8217;re trying to mask<\/p>\n<p>Lastly, <code>eval myfield=replace(my_field,&quot;regex&quot;,&quot;literal string&quot;)<\/code> is almost always faster, in my experience, than <code>rex mode=sed<\/code><\/p>\n<p>Doc.Splunk references for <code>eval<\/code>, <code>rex<\/code>:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/eval\" rel=\"nofollow noreferrer\">https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/eval<\/a>\n<ul>\n<li><a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/TextFunctions#replace.28.26lt.3Bstr.26gt.3B.2C.26lt.3Bregex.26gt.3B.2C.26lt.3Breplacement.26gt.3B.29\" rel=\"nofollow noreferrer\">https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/TextFunctions#replace.28.26lt.3Bstr.26gt.3B.2C.26lt.3Bregex.26gt.3B.2C.26lt.3Breplacement.26gt.3B.29<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/rex\" rel=\"nofollow noreferrer\">https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/rex<\/a><\/li>\n<\/ul>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/76682981\/alternative-to-30-rex-field-path-mode-sed-in-order-to-replace-path-param\/76687967#76687967<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>this sounds like a job for transforms.conf or maybe just to properly extract all those fields with props.conf. If you&#8217;re waiting until search time to mask data, you&#8217;re still storing all of what you&#8217;re trying to mask Lastly, eval myfield=replace(my_field,&quot;regex&quot;,&quot;literal string&quot;) is almost always faster, in my experience, than rex mode=sed Doc.Splunk references for eval, &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=75543\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for Alternative to 30+ `| rex field=path mode=sed&#8230;` in order to replace path parameters in urls<\/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-75543","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\/75543","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=75543"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/75543\/revisions"}],"predecessor-version":[{"id":75544,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/75543\/revisions\/75544"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=75543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=75543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=75543"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=75543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}