Splunk Search

When I am using this search, I am not getting accurate results?

Harish2
Path Finder

Search:

|tstats count where index=att_acc_app  source=applicationissues.log  by PREFIX(client_application_name=) _time span=1d
|rename client_application_name= as client-application-name
|timechart count by  client-application-name span=1d



When i am using this query i am not getting accurate results.


Labels (1)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

What is accurate results? How does your actual results differ from it?  You need to illustrate these points.

0 Karma

Harish2
Path Finder

if i am using without tstats  i am getting one value, when i am using tstats i am getting different value.
both values are not matching.

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Then you need to illustrate what did you do "without tstats", perhaps also results from that (I assume that you believe those are accurate results) so others can understand your intentions and expectations.

0 Karma

Harish2
Path Finder

Original query:
 index=att_acc_app  source=applicationissues.log
|timechart count by client_application_name span=1d

results:
_time                                       ccs     mop     zse          cfr

2023-01-02 00:00:00     10         223     100         12
2023-01-02 00:30:00     80         283     800          67


query using tstats:
|tstats count where index=att_acc_app  source=applicationissues.log  by PREFIX(client_application_name=) _time span=1d
|rename client_application_name= as client-application-name
|timechart count by  client-application-name span=1d

results:
_time                                       ccs     mop     zse          cfr

2023-01-02 00:00:00     5         23            0         11
2023-01-02 00:30:00     90       83        80          69




0 Karma

yuanliu
SplunkTrust
SplunkTrust

This suggests that in some events, values are extracted into client_application_name without being in the immediate right side of the equal sign.  For example, event may contain "client_application_name = mop" and Splunk will assign "mop" to client_application_name.

One way to test this can be

index=att_acc_app  source=applicationissues.log
client_application_name = mop NOT "client_application_name=mop"

 

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
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, ...