Splunk Search

Stats Max issue

willadams
Contributor

I have a query that I am running using dbxquery for specific reasons. Anyway I have run into an interesting issue that I can't seem to put my finger on

My First Query is through SPLUNK 7.2.3 with DBConnect 2.1.4

| dbxquery query="SELECT * FROM \"AppList\".\"dbo\".\"SPLNK_MyTable\"" connection="ApplicationX" wrap=t 
| fields - _raw _time 
| rename "Computer name" AS "name" 
| rename "App File used" AS "App File" 
| rename "Last check-in (GMT)" AS "Last Check In" 
| rename "App Distri" AS "App Version" 
| rename "APPLICATION STATUS" AS "status" 
| eval LastCheckInEpoch=strptime("Last Check In", "%Y-%m-%d %H:%M:%S.%1Q") 
| where (LastCheckInEpoch>= relative_time(now(), "-30d@d") AND LastCheckInEpoch<= now()) 
| stats max(status) as status by name, "App File", "Last Check In", "AppVersion" | eval name=upper(name)

I get results and statistics is happy in his instance.

However running this on SPLUNK 7.2.6 with DBConnect 3.13 I get 0 results. I can't see why. Any suggestions?

Tags (1)
0 Karma

willadams
Contributor

As suggested by to4kawa the where statement looks like it is not working. On checking my strptime command, I noted that I had %Y-%m-%d %H:%M:%S.%1Q but on adjusting this to %Y-%m-%d %H:%M:%S.%3Q, this seems to have done the trick. I also noted that one of my renames had a lower case instead of an upper case which caused it to break as well.

0 Karma

willadams
Contributor

I also had to remove "wrap=t"

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...