Splunk Search

After saving my search as a report on the dashboard, why is the chart data incomplete?

kotig
Path Finder

We have data like this:

TestPath                   200  202  500  302
/test/v1                   51   0   0   0
/test/v1/p1/test1/test   0  1   0   0
/test/v1/p1/test1/test1 0   0   8   0
/test/v1/p1/test1/test2 1   0   0   0

My search shows the data correctly and I see the visualization displays the chart properly, but when I convert that to a report and save it on the dashboard, it shows only 1 record which has data for 500 which is 8 records.

What might be the issue? Attached the images of how the data is shown on search/visualization chart and on the dashboard.

I tried on all kinds of browsers and its the same issue. Any help on what might be the issue would be appreciated.

0 Karma
1 Solution

somesoni2
Revered Legend

Give this a try

index=logdatafile earliest=-3d | rex field=_raw "(?msi)(?\{.+\}$)" | spath input=json_field | table success.successcode,success.path,fault.errorcode,fault.path,fault.errorStatusCode | eval ResponseCode=coalesce('success.successcode', 'fault.errorcode' ,'fault.errorStatusCode') |where isnotnull(ResponseCode) | eval Path=coalesce('success.path','fault.path') | chart count by ResponseCode,Path

View solution in original post

0 Karma

somesoni2
Revered Legend

Give this a try

index=logdatafile earliest=-3d | rex field=_raw "(?msi)(?\{.+\}$)" | spath input=json_field | table success.successcode,success.path,fault.errorcode,fault.path,fault.errorStatusCode | eval ResponseCode=coalesce('success.successcode', 'fault.errorcode' ,'fault.errorStatusCode') |where isnotnull(ResponseCode) | eval Path=coalesce('success.path','fault.path') | chart count by ResponseCode,Path
0 Karma

kotig
Path Finder

This worked. Thank you for your inputs.

0 Karma

Richfez
SplunkTrust
SplunkTrust

How do you specify the time frame of the search?

0 Karma

kotig
Path Finder

i am specifying the time frame as earliest=-3d, below is how my query looks..

index=logdatafile earliest=-3d | rex field=_raw "(?msi)(?\{.+\}$)" | spath input=json_field | table success.successcode,success.path,fault.errorcode,fault.path,fault.errorStatusCode | rename success.successcode as ResponseCode | rename fault.errorcode as ResponseCode|rename fault.errorStatusCode as ResponseCode| rename success.path as Path | rename fault.path as Path|where isnotnull(ResponseCode)| chart count by ResponseCode,Path
0 Karma
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...