{"id":69333,"date":"2023-01-05T19:37:57","date_gmt":"2023-01-05T19:37:57","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=69333"},"modified":"2023-01-05T19:37:57","modified_gmt":"2023-01-05T19:37:57","slug":"answer-by-warren-for-splunk-event-json-to-table","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=69333","title":{"rendered":"Answer by warren for Splunk Event JSON to Table"},"content":{"rendered":"<p>I <em>suspect<\/em> something like the following will work &#8211; but you&#8217;re better off either getting this data as <em>proper<\/em> JSON (so Splunk handles it natively), or fixing your props.conf and transforms.conf<\/p>\n<pre><code>| rex field=_raw max_match=0 &quot;id\\W+(?&lt;id&gt;\\d+)&quot;\n| rex field=_raw max_match=0 &quot;updatedAt\\W+(?&lt;updated&gt;[^\\&quot;]+)&quot;\n| rex field=_raw max_match=0 &quot;createdAt\\W+(?&lt;created&gt;[^\\&quot;]+)&quot;\n| rex field=_raw max_match=0 &quot;feature\\W+(?&lt;feature&gt;[^\\&quot;]+)&quot;\n| rex field=_raw max_match=0 &quot;enabled\\W+(?&lt;enabled&gt;\\w+)&quot;\n<\/code><\/pre>\n<p>Those will all be multivalue fields &#8211; so you <em>may<\/em> need to <code>mvzip<\/code> and then <code>mvexpand<\/code> them out (reextracting afterwards) like this:<\/p>\n<pre><code>| eval an_event=mvzip(mvzip(mvzip(mvzip(id,updated,&quot;;&quot;),created,&quot;;&quot;),feature,&quot;;&quot;),enabled,&quot;;&quot;)\n| fields - id updated created feature enabled\n| mvexpand an_event\n| rex field=an_event &quot;(?&lt;id&gt;[^;]+);(?&lt;updated&gt;[^;]+);(?&lt;created&gt;[^;]+);(?&lt;feature&gt;[^;]+);(?&lt;enabled&gt;.+)&quot;\n<\/code><\/pre>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/75020638\/splunk-event-json-to-table\/75023521#75023521<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I suspect something like the following will work &#8211; but you&#8217;re better off either getting this data as proper JSON (so Splunk handles it natively), or fixing your props.conf and transforms.conf | rex field=_raw max_match=0 &quot;id\\W+(?&lt;id&gt;\\d+)&quot; | rex field=_raw max_match=0 &quot;updatedAt\\W+(?&lt;updated&gt;[^\\&quot;]+)&quot; | rex field=_raw max_match=0 &quot;createdAt\\W+(?&lt;created&gt;[^\\&quot;]+)&quot; | rex field=_raw max_match=0 &quot;feature\\W+(?&lt;feature&gt;[^\\&quot;]+)&quot; | rex field=_raw max_match=0 &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=69333\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for Splunk Event JSON to Table<\/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-69333","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\/69333","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=69333"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/69333\/revisions"}],"predecessor-version":[{"id":69334,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/69333\/revisions\/69334"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=69333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=69333"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=69333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}