Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

I'm creating event rule, facing issues on to map the node field

Ashfaq Naina A
Tera Expert

Hi 

I'm trying to create a event rule, In the event I can see the node name in additional information field I want to take the data and put it to Node field, when I drag the data in regex its woring with only one node because when I drag select its hardcoded, I want to use the regex code the get the data but not able to identify where to update the code to get the data.

3 REPLIES 3

BharatC
Kilo Guru

Hello @Ashfaq Naina A 

 

Regex to use: Host=([^,]+)

 

Follow these steps:

 

1) Go to Event Rule → Field Mapping
2) Set: 1) Source Field: additional_info
2) Target Field: node
3) Enable "Use Regex"
4) In Regex:
1)Enter: Host=([^,]+)
2) Set Group = 1

 

Please click helpful if it helps you 

Regards

Hello @BharatC 

Where to set the source and target field I can't see any options. Please help..

amit_bt
Tera Expert

To extract the node name dynamically from the Additional Information field (which is a JSON blob) and map it to the Node field, you should avoid the "drag and select" method and instead use the Event Rule Transform tab with a manual Regex configuration.

Make a new field (e.g node1) with regex and place that in node field (i.e $node1) in event rule. Node field can be seen under event input (Right Side panel)