How to define a smart group based on an empty extension attribute field in date format?

mschroder
Valued Contributor

Dear Experts,

I hope this is not too twisted. In fact it is not as twisted as the title suggests (I believe).

I have an extension attribute that is a date. For many nodes the entry for that EA is empty. Is there a way to use that as a criterion for smart group membership? The reports with an empty 'value_on_client' field have '0' in the 'date_value_epoch' field, which corresponds to 1970 01 01 01:00:00. So I would expect that a criterion like before '2000-01-01' should catch all these. Unfortunately it does not, I expect that jamf does a special treatment for the empty date field.

Did anybody succeed in finding a criterion to select empty date fields?

Thanks in advance for your help,

Matthias

3 REPLIES 3

mm2270
Legendary Contributor III

There's seemingly no way to do this, likely because of how the data is stored in the database (Date vs plain string) I have a small number of machines that have an empty value in a date based EA and I couldn't figure out a way to gather them. Even using something like more than x days ago and putting in something like 10000 for the value doesn't gather them. : /
I noticed in my case, those few systems with the empty value are not showing anything for it in the API. It just has a <value/> tag where it would normally be <value>[some value]</value>

There is a way to build Smart Groups on empty data in regular string fields, but I was recently told by Jamf this is not recommended. Apparently this puts a strain on the JSS because it's akin to doing a wilcard search against an entire table in the db, versus looking for something specific. Especially if that table is large, like I recently had an issue with, this makes Smart Group calculations that use that information (and use a blank criteria search) eat up a lot of resources and hold onto connections from the Tomcat web apps into the database, so it's not a great idea overall.

Look
Valued Contributor III

Unless this is the way that @mm2270 was told not to use you can do it using two smart groups.

Create one group with the criteria:
XXX More than 0 days
or
XXX Less than 0 days

This will return every computer with a date in the specified field.

Then create a second group with the criteris:
Computer Group Not a member of First Group

This will return all the blank dates for that field.

trademarkable
New Contributor II

Thanks for this, @Look - this saves a lot of time when doing a lookup!