RQL - How to add JSON field conditionally

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RQL - How to add JSON field conditionally

L0 Member

I'm trying to addcolumn with a field from a JSON configuration, but only  if certain condition of another field is satisfied.

 

Something like this:

config from cloud.resource where api.name = 'aws-api-xyzl'  CONDITIONS addcolumn $.list[ if CONDITIION_FIELD equals 12345)].FIELD_OF_INTEREST

 

I already tryed the filter syntax used in JSON.RULES assertion, but it didn't work:

config from cloud.resource where api.name = 'aws-api-xzyl' CONDITION addcolumn $.list[?any(FIELD_FOR_CONDITION == CONDITION)].FIELD_OF_INTERERST
1 REPLY 1

L1 Bithead

Conditional statements are not supported in RQL.

  • 925 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!