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!

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

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

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...