There are a number of ways to do this, but a simple approach is to do something like this search earliest=-2mon@mon latest=@mon
| bin _time span=1mon
| stats count by _time CN
| stats dc(_time) as t...
See more...
There are a number of ways to do this, but a simple approach is to do something like this search earliest=-2mon@mon latest=@mon
| bin _time span=1mon
| stats count by _time CN
| stats dc(_time) as times values(_time) as _time by CN
| eventstats dc(eval(if(times=1 AND _time=relative_time(now(), "-1mon@mon"), CN, null()))) as "New" dc(eval(if(times=1 AND _time=relative_time(now(), "-2mon@mon"), CN, null()))) as "Old" dc(eval(if(times=2, CN, null()))) as "Returning" but this will never class the first month users as new, it only compares last month with previous month, i.e. in this case October vs September - you can change the times to do October and partial November. If you want a different approach you can keep a lookup of users who are "known" and then simply look at the current month and lookup the user against the lookup. If they do not exist, they are new. You will also have to roll over the 'new' users for this month to the lookup at the end of the month