Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Gitlf Frequent Contributor.
Frequent Contributor.
292 views

How can I use the "get_activelist_value" asking for a NULL IP address field?

Our context is:

We have an active list that stores all our critical devices with the following format:

  • Device Host Name (String type) --> Key value
  • Device Address (IP address type) --> Key value
  • Other fields (String type) --> Not key values, just different info tags about the devices

Our desire is to query this list in a query with the "get_activelist_value" function, passing the first two fields (Device Host Name and Device Address) and getting the corresponding fields for the device.

The problem is that we have some devices that don't have an IP address, they are only identified by the hostname. In this cases, the field Device Address in the list is empty (NULL) and it is not possible to pass a NULL IP Address with the function "get_activelist_value". The only similar option is to pass "0.0.0.0", and it doesn't match with the entry in the active list.

Any idea on how to solve this? Thank you in advance!!

0 Likes
10 Replies
Knowledge Partner
Knowledge Partner

Re: How can I use the "get_activelist_value" asking for a NULL IP address field?

First of all, key fields must have a value. Otherwise, it can cause problems. 

If the AL is populated by a rule, then you can use evaluate velocity template and populate the IP information. Then, you can use your query without an issue.

------------------------------------
Please use the Like button below, if you find this post useful or mark it as an accepted solution if it resolves your issue.
0 Likes
Highlighted
Gitlf Frequent Contributor.
Frequent Contributor.

Re: How can I use the "get_activelist_value" asking for a NULL IP address field?

I tried to assign the value "0.0.0.0" in the active list entry, but it is changed and stored as NULL.
The active list is not populated by a rule, it's a list of our most critial devices and we complete it manually.
Thank you for your help, but your reply doesn't solve my problem.
0 Likes
Knowledge Partner
Knowledge Partner

Re: How can I use the "get_activelist_value" asking for a NULL IP address field?

I can assign 0.0.0.0 on ESM 6.11. Either there is a bug or the active list is broken somehow.

image.png

------------------------------------
Please use the Like button below, if you find this post useful or mark it as an accepted solution if it resolves your issue.
0 Likes
Gitlf Frequent Contributor.
Frequent Contributor.

Re: How can I use the "get_activelist_value" asking for a NULL IP address field?

Well, that's surprising. In your example the "dvcip" is an IP Address type field, right?
I can't do that in ESM 6.9. I have tried adding the entry with the "Active List Entry Editor". Did you do it using a different method?
0 Likes
Knowledge Partner
Knowledge Partner

Re: How can I use the "get_activelist_value" asking for a NULL IP address field?

dvchost->string (key field)
dvcip->IPAddress (key field)

entries added with "active list entry editor".
Active list scheme on ESM 6.9 is different than 6.11. dvcip is of IP Address type.  On 6.9, the type is Address, subtype is IP Address.

image.png

Instead of 0.0.0.0, Can you try with "1.1.1.1" or any IP different than 0.0.0.0?

------------------------------------
Please use the Like button below, if you find this post useful or mark it as an accepted solution if it resolves your issue.
Gitlf Frequent Contributor.
Frequent Contributor.

Re: How can I use the "get_activelist_value" asking for a NULL IP address field?

Any other IP works, it is loaded into the list. But with 0.0.0.0 the field loaded is NULL.

Assuming that it's not possible to assign the value "0.0.0.0" in the active list entry, it is going to be NULL. Could I create a local variable and assign it to NULL, and use it in the "get_activelist_value" function against the list? I don't know how to do this.
0 Likes
Knowledge Partner
Knowledge Partner

Re: How can I use the "get_activelist_value" asking for a NULL IP address field?

You have to pass a value for all the key fields in the GetActiveListValue function. Can you get a preview result if you pass 0.0.0.0 for the local variable? 

image.png

------------------------------------
Please use the Like button below, if you find this post useful or mark it as an accepted solution if it resolves your issue.
0 Likes
Gitlf Frequent Contributor.
Frequent Contributor.

Re: How can I use the "get_activelist_value" asking for a NULL IP address field?

If I pass 0.0.0.0  the function doesn't return any result, because there is no entry with 0.0.0.0. The entry that I want to get is the one with the NULL field. But I can't make a query asking for a NULL entry...

 

It's a bit annoying, because it's not possible to load an entry with 0.0.0.0, and it's not possible to query for a NULL entry neither.

0 Likes
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Re: How can I use the "get_activelist_value" asking for a NULL IP address field?

Few things 6.9 and 6.11 is hard to compare as an IP field on 6.9 is, strictly, a numeric field. On 6.11 it behaves differently because we support ipv4 or ipv6 on these fields. That said, the NULL thing is a possibility as some field may be empty and we insert it. Trying to manually match on it can be complex as it can only really be matched against another event with the same information in there. Trying to just leave it blank doesn't work: blank != NULL, which is what seems to be inserted. I did a workaround this a while ago checking if a field was null and inserting blank instead, through a global variable, which I could use later in rules to insert.
0 Likes
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Re: How can I use the "get_activelist_value" asking for a NULL IP address field?

I remembered how I did it in the past to match. I created a different activelist, where I can match with a "blank" entry and it returns a "Null" value. I used a rule to insert an entry in that active list and the entry key was blank (not coming from an event field) inserting a null field (coming from an event field). With that, I would create a global field that matched it, so I could use it in queries. If I know the field I am trying to match could be problematic, would use it to verify the match and extract/insert it into the active list. I resort to this when I can't be picky with what I am inserting (for example a combo of hostname + ip where I still want to insert, even if the ip or hostname is null. We did have a problem related to NULL entries and Active Lists detected in 6.8 and 6.9/6.9.1, but this specific problem was solved in 6.11. Are you running the latest patch on 6.9.1?
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.