{"id":72071,"date":"2023-03-28T19:32:16","date_gmt":"2023-03-28T19:32:16","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=72071"},"modified":"2023-03-28T19:32:16","modified_gmt":"2023-03-28T19:32:16","slug":"answer-by-warren-for-splunk-remove-curly-braces-from-result","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=72071","title":{"rendered":"Answer by warren for Splunk &#8211; Remove Curly Braces from Result"},"content":{"rendered":"<p>Is it safe to assume the fields <code>statusCode<\/code> and <code>duration<\/code> currently hold &quot;<code>{ 200 }<\/code>&quot; and &quot;<code>{ 277.429137ms }<\/code>&quot;, respectively?<\/p>\n<p>Instead of using a regular expression to create a new field, use <code>eval .. replace<\/code> to clean up the fields you have:<\/p>\n<pre><code>| eval statusCode=replace(statusCode,&quot;\\D&quot;,&quot;&quot;)\n| eval duration=replace(duration,&quot;[^\\.\\w]&quot;,&quot;&quot;)\n<\/code><\/pre>\n<p>Alternatively, if you don&#8217;t have those fields yet, this will extract them both for you (returning just what you&#8217;re looking for with each):<\/p>\n<pre><code>| rex field=_raw &quot;statusCode\\D+(?&lt;statusCode&gt;\\d+)&quot;\n| rex field=_raw &quot;duration\\W+(?&lt;duration&gt;[\\.\\w]+)&quot;\n<\/code><\/pre>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/75868319\/splunk-remove-curly-braces-from-result\/75870356#75870356<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Is it safe to assume the fields statusCode and duration currently hold &quot;{ 200 }&quot; and &quot;{ 277.429137ms }&quot;, respectively? Instead of using a regular expression to create a new field, use eval .. replace to clean up the fields you have: | eval statusCode=replace(statusCode,&quot;\\D&quot;,&quot;&quot;) | eval duration=replace(duration,&quot;[^\\.\\w]&quot;,&quot;&quot;) Alternatively, if you don&#8217;t have those fields &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=72071\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for Splunk &#8211; Remove Curly Braces from Result<\/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-72071","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\/72071","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=72071"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/72071\/revisions"}],"predecessor-version":[{"id":72072,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/72071\/revisions\/72072"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72071"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=72071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}