Splunk Search

Not getting by day results for a timechart

di2esysadmin
Path Finder

I'm banging my head against the wall. Here's my search:

host="atlassian-stash*" sourcetype=atlassian source="/opt/atlassian/stash-data/log/atlassian-stash-access*.log" | timechart dc(stash_users) span=1d AS "Unique Stash Users"

stash_users is an extracted field. Pretty clear from search results that it's working correctly.

When I run the above, I get 8 results (as though it thinks it's giving me by day results) the only days with values are 2/18 and 2/11. As though it's counting unique stash_users by week.

I have this precise format working with a different extracted field on a different file. Hence the head banging.

Help appreciated.

Karla

Tags (1)
0 Karma
1 Solution

di2esysadmin
Path Finder

That's it! The problem is my field extraction. It was based on a filename. The entries for the others days came from log files with a different named format.

Thanks for the ideas!

View solution in original post

0 Karma

di2esysadmin
Path Finder

That's it! The problem is my field extraction. It was based on a filename. The entries for the others days came from log files with a different named format.

Thanks for the ideas!

0 Karma

di2esysadmin
Path Finder

There has to be a problem with the way I've extracted the field. It's too simple for it to be anything else.

0 Karma

di2esysadmin
Path Finder

No change in behavior. 😞

0 Karma

yannK
Splunk Employee
Splunk Employee

Just for sanity,

change the order of your timechart to avoid having the span between the function and the "AS"
| timechart span=1d dc(stash_users) AS "Unique Stash Users"

linu1988
Champion

what do u get by host="atlassian-stash"

sourcetype=atlassian source="/opt/atlassian/stash-data/log/atlassian-stash-access.log"|bucket _time span=1d| stats dc(stash_users) by _time?

0 Karma

di2esysadmin
Path Finder

Didn't fix it. Here's my query now:

host="atlassian-stash*" sourcetype=atlassian source="/opt/atlassian/stash-data/log/atlassian-stash-access*.log" | timechart span=1d dc(stash_users) AS "Unique Stash Users"

0 Karma

yannK
Splunk Employee
Splunk Employee

good, @di2esysadmin please accept the answer to mark it as resolved.

0 Karma

linu1988
Champion

This is it 😄

0 Karma

linu1988
Champion

What do you get if you just make a |bucket _time span=1d| stats dc(stash_users) by _time instead of timechart?

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...