- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
04-20-2023 02:27 AM - edited 04-20-2023 02:28 AM
Hi Expert ,
I want to filter out some info from dataset such as " message:111.111.111.11" I want to filter just IP-address with regex and remove "message:" how to filter it on XQL
Thank you
04-20-2023 03:56 AM
Thank you for writing to live community!
Since you want to extract IP only then one way you may achieve it by using regextract. Assuming the field name as "log" in which you have this value i.e. " message:111.111.111.11". Then using below way you may extract the IP.
dataset=xyz
| alter IP = regextract(log, "(\d+\.\d+\.\d+\.\d+)")
Hope this helps!
Please mark the response as "Accept as Solution" if it answers your query.
Thanks
04-20-2023 03:56 AM
Thank you for writing to live community!
Since you want to extract IP only then one way you may achieve it by using regextract. Assuming the field name as "log" in which you have this value i.e. " message:111.111.111.11". Then using below way you may extract the IP.
dataset=xyz
| alter IP = regextract(log, "(\d+\.\d+\.\d+\.\d+)")
Hope this helps!
Please mark the response as "Accept as Solution" if it answers your query.
Thanks
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!