<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: capture error 4xx/5xx in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/capture-error-4xx-5xx/m-p/741754#M240685</link>
    <description>&lt;P&gt;Are your fields auto extracted, i.e. if you just do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=*    source IN ("/aws/lambda/*")  msg="**"&lt;/LI-CODE&gt;&lt;P&gt;in verbose search mode, do you see error.status in the left hand panel? If so, can you see values of 4xx and 5xx?&lt;/P&gt;&lt;P&gt;It may be that if your JSON objects are longer than 5k, the status field may not be auto extracted, so you could try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* source IN ("/aws/lambda/*")  msg="**"
| spath error.status
| search (error.status=4* OR error.status=5*)
| eval status=case(like(error.status, "4%"), "4xx", like(error.status, "5%"), "5xx") 
| stats count by error.status&lt;/LI-CODE&gt;&lt;P&gt;which will tell you if it's a JSON object limit&lt;/P&gt;</description>
    <pubDate>Fri, 14 Mar 2025 04:34:26 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2025-03-14T04:34:26Z</dc:date>
    <item>
      <title>capture error 4xx/5xx</title>
      <link>https://community.splunk.com/t5/Splunk-Search/capture-error-4xx-5xx/m-p/741736#M240680</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Using below query to capture 4xx,5xx error ,but getting as no result found&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=*    source IN ("/aws/lambda/*")  msg="**"
(error.status=4* OR error.status=5*)
| eval status=case(like(error.status, "4%"), "4xx", like(error.status, "5%"), "5xx") | stats count by error.status&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-03-13 at 3.49.38 PM.png" style="width: 746px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38179i8FE2216FF796DC9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-03-13 at 3.49.38 PM.png" alt="Screenshot 2025-03-13 at 3.49.38 PM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-03-13 at 3.51.18 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38178iB7C73FCF2B6F1E3B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-03-13 at 3.51.18 PM.png" alt="Screenshot 2025-03-13 at 3.51.18 PM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-03-13 at 3.48.27 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38180iCA543E401D4AD463/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-03-13 at 3.48.27 PM.png" alt="Screenshot 2025-03-13 at 3.48.27 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"name":"","","pid":8,"level":50,"error":{"message":"Request failed with status code 500","name":"AxiosError","stack":"AxiosError: Request failed with status code 500\n    )","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"X","xsrfHeaderName":"X-","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","Authorization":"","User-Agent":"","Accept-Encoding":"gzip, compress, deflate, br"},"method":"get",""},"code":"ERR_BAD_RESPONSE","status":500},"eventAttributes":{"Identifier":2025732,"VersionNumber":"A.43"},"msg":"msg:data:error","time":":48:38.213Z","v":0}&lt;/LI-CODE&gt;&lt;P&gt;this is my raw event format mostly looks like&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 22:58:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/capture-error-4xx-5xx/m-p/741736#M240680</guid>
      <dc:creator>nithys</dc:creator>
      <dc:date>2025-03-13T22:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: capture error 4xx/5xx</title>
      <link>https://community.splunk.com/t5/Splunk-Search/capture-error-4xx-5xx/m-p/741754#M240685</link>
      <description>&lt;P&gt;Are your fields auto extracted, i.e. if you just do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=*    source IN ("/aws/lambda/*")  msg="**"&lt;/LI-CODE&gt;&lt;P&gt;in verbose search mode, do you see error.status in the left hand panel? If so, can you see values of 4xx and 5xx?&lt;/P&gt;&lt;P&gt;It may be that if your JSON objects are longer than 5k, the status field may not be auto extracted, so you could try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* source IN ("/aws/lambda/*")  msg="**"
| spath error.status
| search (error.status=4* OR error.status=5*)
| eval status=case(like(error.status, "4%"), "4xx", like(error.status, "5%"), "5xx") 
| stats count by error.status&lt;/LI-CODE&gt;&lt;P&gt;which will tell you if it's a JSON object limit&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 04:34:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/capture-error-4xx-5xx/m-p/741754#M240685</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-03-14T04:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: capture error 4xx/5xx</title>
      <link>https://community.splunk.com/t5/Splunk-Search/capture-error-4xx-5xx/m-p/741759#M240687</link>
      <description>&lt;P&gt;Is it possible that your raw event is noncompliant? &amp;nbsp;This is what your illustrated event format suggests. &amp;nbsp;If that format is exact, Splunk cannot extract anything other than "name" field. &amp;nbsp;There are two elements that violates JSON syntax. &amp;nbsp;The mock event contains two bare strings that are not key-value pairs, as pointed out as "MISSING-KEY1" and "MISSING-KEY2" in the following pretty-print of a "corrected" conformant JSON object:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "name": "",
    "MISSING-KEY1": "",
    "pid": 8,
    "level": 50,
    "error": {
        "message": "Request failed with status code 500",
        "name": "AxiosError",
        "stack": "AxiosError: Request failed with status code 500\n    )",
        "config": {
            "transitional": {
                "silentJSONParsing": true,
                "forcedJSONParsing": true,
                "clarifyTimeoutError": false
            },
            "adapter": [
                "xhr",
                "http"
            ],
            "transformRequest": [
                null
            ],
            "transformResponse": [
                null
            ],
            "timeout": 0,
            "xsrfCookieName": "X",
            "xsrfHeaderName": "X-",
            "maxContentLength": -1,
            "maxBodyLength": -1,
            "env": {},
            "headers": {
                "Accept": "application/json, text/plain, */*",
                "Content-Type": "application/json",
                "Authorization": "",
                "User-Agent": "",
                "Accept-Encoding": "gzip, compress, deflate, br"
            },
            "method": "get",
            "MISSING-KEY2": ""
        },
        "code": "ERR_BAD_RESPONSE",
        "status": 500
    },
    "eventAttributes": {
        "Identifier": 2025732,
        "VersionNumber": "A.43"
    },
    "msg": "msg:data:error",
    "time": ":48:38.213Z",
    "v": 0
}&lt;/LI-CODE&gt;&lt;P&gt;If your actual events are non-compliant, Splunk will not have a value for error.status.&lt;/P&gt;&lt;P&gt;By the way, &amp;nbsp;the command "eval status=case(like(error.status, "4%"), "4xx", like(error.status, "5%"), "5xx")" is wasted as your stats command does not use the field status.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 05:33:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/capture-error-4xx-5xx/m-p/741759#M240687</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2025-03-14T05:33:45Z</dc:date>
    </item>
  </channel>
</rss>

