cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

AO - Generate gateway from input IP address

455
Views
0
Helpful
0
Comments

 Problem: 

 

User inputs an IP address and the gateway needs to be created from that input. 

In this case a /24 is used and the gateway is at the low end. 

 

Example: 

 

User input is 10.20.30.40 and the output for the gateway should be 10.20.30.1 

 

Here is the workflow: 

 

Screen Shot 2018-11-10 at 7.28.00 AM.pngUsing a string split with regex and a set varaibles

 

Workflow has 2 variables: 

 

Screen Shot 2018-11-10 at 7.28.55 AM.pngone user input and one global variable

 

The split string looks like this: 

 

Screen Shot 2018-11-10 at 7.22.31 AM.png

 

Note the regex( \.\d+$ ) which returns the first 3 octets and end up in the first part of the split return

 

Screen Shot 2018-11-10 at 7.27.22 AM.png

The set variable takes the first part and attaches the .1 

 

The result is this: 

 

Screen Shot 2018-11-10 at 7.27.09 AM.png

 

 

 https://github.com/ogelbric/CCCAOWorkflows/tree/master/definition_workflow_1CmKxQqlRkqtZyC2hJucyRflM4w

 

 

 

 

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards
This widget could not be displayed.