none
How to seach string with json data in appinsights

    Question

  • I have a table with message column. How do i filter logs wich has "countryData": with "success":"true" vaues.

    Message column cotains data with text and json string like below

    Json string starts from "rootdata" attribute below.

    Log data, Processed=True, "rootdata":{"status":0,"data":{"WorldData":null, "countryData":{"success":"false","applnstate":0,"Count":0}}}

    Log data, Processed=True, "rootdata":{"status":0,"data":{"WorldData":null, "countryData":{"success":"true","applnstate":0,"Count":0}}}

    Wednesday, December 19, 2018 11:25 AM

Answers

  • Hi Ganeshksg12,

    Thank you for using Application insights.

    Can you please check if you can add a filter for the particular message column you are referring to and see in what format the data is showing up in the query , based on which you can trim down the query with contains to ‘success: true’ which you are looking for.

    Tried to replicate by ingesting some data into Application Insights instance and with below query was able to filter it with  \'countryData\':{\'success\':\'true\'

    (Below query is focused on traces but the same should work with requests)

    traces

    | where message contains "\'countryData\':{\'success\':\'true\'"

    Hope the above information helps to further dive into Application Insights features. Please let us know if you have any further questions. Thanks

    Wednesday, December 19, 2018 11:27 PM
    Owner

All replies

  • Hi Ganeshksg12,

    Thank you for using Application insights.

    Can you please check if you can add a filter for the particular message column you are referring to and see in what format the data is showing up in the query , based on which you can trim down the query with contains to ‘success: true’ which you are looking for.

    Tried to replicate by ingesting some data into Application Insights instance and with below query was able to filter it with  \'countryData\':{\'success\':\'true\'

    (Below query is focused on traces but the same should work with requests)

    traces

    | where message contains "\'countryData\':{\'success\':\'true\'"

    Hope the above information helps to further dive into Application Insights features. Please let us know if you have any further questions. Thanks

    Wednesday, December 19, 2018 11:27 PM
    Owner
  • Thank you so much.
    Friday, December 21, 2018 9:33 AM