I want to use rex to get a field value.
Now I have a field named URL
Some data such as :
But I just want to get such as
The above data is written randomly according to my data.
That is to say I only hope to get [http|https]://IP:port OR [http|https]://domain
What should I do?
Lets say your url data is in field called URL then you can try below to get the required data in a field called myRequiredData:
your query to return URL field
| rex field=URL "(?<myRequiredData>(http(s)*:\/\/)[^\/\s]+)"
| table URL, myRequiredData
See the regex reference here