{"id":61298,"date":"2022-08-02T12:32:45","date_gmt":"2022-08-02T12:32:45","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=61298"},"modified":"2022-08-02T12:32:45","modified_gmt":"2022-08-02T12:32:45","slug":"answer-by-warren-for-how-to-get-particular-field-in-splunk-search-for-a-nested-json-event","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=61298","title":{"rendered":"Answer by warren for How to get particular field in splunk search for a nested JSON event"},"content":{"rendered":"<p>There are at least two approaches you can use<\/p>\n<p>If your sourcetype&#8217;s JSON is not being parsed properly by Splunk, this <a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/rex\" rel=\"nofollow noreferrer\"><code>rex<\/code><\/a> will pull it for you:<\/p>\n<pre><code>| rex field=_raw &quot;userid=(?&lt;userid&gt;\\w+)&quot;\n<\/code><\/pre>\n<p>If it <em>is<\/em> being parsed properly, then you can probably get it by <a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/rename\" rel=\"nofollow noreferrer\">a<\/a> variation on the theme of:<\/p>\n<pre><code>| rename applicationTags{}.userid as userid\n<\/code><\/pre>\n<p>To get a full listing of the fields Splunk knows about for this sourcetype, use <a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/fieldsummary\" rel=\"nofollow noreferrer\"><code>fieldsummary<\/code><\/a>. Eg:<\/p>\n<pre><code>index=ndx sourcetype=srctp\n| fieldsummary\n| fields field values\n<\/code><\/pre>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/73202763\/how-to-get-particular-field-in-splunk-search-for-a-nested-json-event\/73207521#73207521<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are at least two approaches you can use If your sourcetype&#8217;s JSON is not being parsed properly by Splunk, this rex will pull it for you: | rex field=_raw &quot;userid=(?&lt;userid&gt;\\w+)&quot; If it is being parsed properly, then you can probably get it by a variation on the theme of: | rename applicationTags{}.userid as userid &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=61298\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for How to get particular field in splunk search for a nested JSON event<\/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-61298","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\/61298","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=61298"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/61298\/revisions"}],"predecessor-version":[{"id":61299,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/61298\/revisions\/61299"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61298"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=61298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}