0

I have 2 kind of response body for a api: 1st:

[RESPONSE] ENDPOINT=/my_dummy_endpoint , RESPONSE_BODY= {my_dummy_variable_1":false}

and 2nd:

[RESPONSE] ENDPOINT=/my_dummy_endpoint , RESPONSE_BODY= { "my_dummy_variable_1":true, "my_dummy_variable_2":my_dummy_output}

I have a usecase where I need to filter using Log Insight.

My log insight query:

fields @my_dummy_response
| filter @my_dummy_response like '/my_dummy_endpoint' 
| parse 'my_dummy_variable_1= *}' as @my_dummy_value
| display @my_dummy_value, @my_dummy_response

above one working fine with 1st, but not with 2nd, inside 2nd I am getting like true, "my_dummy_variable_2":my_dummy_output as @my_dummy_value

Can we use regex inside parse, I want do a OR operation on. } and , inside parse, something like

| parse 'my_dummy_variable_1= *$regex' as @my_dummy_value

here $regex can be '[,}]'

ratnesh
  • 436
  • 1
  • 5
  • 16

0 Answers0