Remove special character in KQL query

Karthick G 101 Reputation points
2022-10-10T10:05:13.647+00:00

Am looking for a way to remove special character '-' from mac address in KQL query

current value: 68-a9-e2-14-cz-58

expected outcome: 68a9e214cz58

Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
547 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 117.9K Reputation points MVP
    2022-10-10T10:08:46.037+00:00

    Hi @Karthick G ,

    maybe this helps to get started: https://stefanstranger.github.io/2019/05/16/UsingReplaceKusto/

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. George Moise 2,361 Reputation points Microsoft Employee
    2022-10-10T10:39:50.607+00:00

    Hi @Karthick G ,

    @Andreas Baumgarten is right, replace or replace_string are the operators that you need to use.

    Here's a code that will solve your problem:

    let current_value = '68-a9-e2-14-cz-58';  
    print current_value=current_value  
    | extend expected_outcome=replace_string(current_value,'-','')  
    

    If the above helps you, please don't forget to Accept answer.

    Thank you!
    BR,
    George

    2 people found this answer helpful.
    0 comments No comments

  2. Karthick G 101 Reputation points
    2022-10-10T12:13:55.3+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.