AnsweredAssumed Answered

Are there getters for meta keys in LUA?

Question asked by Tomi Reiman on Jul 14, 2016
Latest reply on Jul 14, 2016 by William Motley

Does there exist a function to get the value of a specific meta key when writing LUA parsers for log content? My use case is the following:

 

I want to perform some additional processing on the url meta when it is registered but only in the case where the device.type associated with the log event is A. If the device.type is, say, B instead, I do not want to do anything. I.e.:

 

if meta 'url' is registered and 'device.type' equals 'A' then

   call function parseURL

end

 

Or if that is not possible, then:

 

if meta 'url' is registered then

   call function parseURL

   if 'device.type' is not nil and 'device.type' equals 'A' then

      ...do something...

   end

end

 

To put it short, I am kind of looking for the opposite of "nwlanguage.create" - something like 'nwlanguage.get("metaKey")'. I suppose this could be done by simply looking for a string in the payload, but that seems like unnecessarily heavy if such a getter exists.

Outcomes