How to filter out some information with XQL

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

How to filter out some information with XQL

L1 Bithead

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 

1 accepted solution

Accepted Solutions

L4 Transporter

Hi @Pattarachai-FTH 

 

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

View solution in original post

1 REPLY 1

L4 Transporter

Hi @Pattarachai-FTH 

 

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

  • 1 accepted solution
  • 1189 Views
  • 1 replies
  • 0 Likes
  • 78 Subscriptions
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!