Skip to main content
Question

With Problem Smart Group Using a 'Date' Result from Extension Attribute


Forum|alt.badge.img+12

Dear experts,

I am struggling with a smart computer group that is using a 'date' type result from an Extension Attribute. The EA is returning the date as 'YYYY-MM-DD hh:mm:ss', and I see the values in the JSS and in the mysql table. But I when I try to use any of the date type operators I always end up with an empty group. Any idea what might be wrong?

4 replies

Forum|alt.badge.img+9
  • New Contributor
  • 140 replies
  • March 24, 2017

Can we see an example of your output to make sure it's formatted correctly?


Forum|alt.badge.img+12
  • Author
  • Valued Contributor
  • 359 replies
  • March 24, 2017

Hi,

thanks for your interest. Let's start with the EA, the relevant part is

...
if [ $isLocalIP -eq 1 ]; then date=$( date "+%Y-%m-%d %H:%M:%S" ) echo "<result>$date</result>"
fi

exit 0
...

On the JSS it looks like this: "LastTimeOnSite: 2017-03-24 11:31:21"

The DB gives me:
...
mysql> select report_id, value_on_client from extension_attribute_values where extension_attribute_id = 8;
--------------------------------
| report_id | value_on_client |
--------------------------------
| -1 | |
| 1780 | |
| 1805 | 2017-03-24 11:08:07 |
| 1809 | 2017-03-24 11:31:21 |
| 1808 | 2017-03-24 11:30:26 |
| 1806 | 2017-03-24 11:20:27 |
| 1804 | 2017-03-24 10:51:22 |
| 1807 | 2017-03-24 10:51:22 |
| 1781 | |
--------------------------------+
9 rows in set (0.00 sec)

mysql> ...

I assume it it something rather simple, but I don't spot it.


mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • March 24, 2017

Hmm. Nothing looks wrong about your EA to me at first glance. The EA is saved as a Date Extension Attribute I assume, or else you wouldn't even be able to try creating a Smart Group based on a date value.
Can you give us an example of an advanced search or Smart Group criteria you're using that isn't populating anything?


Forum|alt.badge.img+12
  • Author
  • Valued Contributor
  • 359 replies
  • March 27, 2017

Tes, the EA is saved with a Data Type of Date.

The smart group is very simple, there is just one single criterion: "LastTimeOnSite after 2017-01-01":

I also tried
- 'before' that date,
- before 2018-01-01
- less than x days ago, with x being 1 or 0
- more than x day ago, with x being 1 or 0

For all of these the smart group shows zero members.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings