Splunk Search

Extract aggregated micro-service calls

cmahoney
Loves-to-Learn

I have a service that is 1 to many microservice so I am aggregating the backend calls into a single entry.  

 

 

{
  "time": "2020-11-11 10:10:12.123",
  "app": "myApp",
  "env": "test",
  "httpMethod": "GET",
  "request":{
    "attributes": [{"key1":"val1"},{"key2":"val2"}]
  },
  "response":{"UI.text":"hello world - Success"},
  "totalDuration": 543,
  "backEndCalls": [
    {
      "method": "GET",
      "url": "https://myservices.foo/backend1",
      "reqeust":{
          "attributes": [{"key1":"val1"},{"key2":"val2"}]
      },
      "response": {
          "display.text":"hello world"
      },
      "timing": 123
    },
    {
      "method": "GET",
      "url": "https://myservices.foo/backend2",
      "reqeust":{
          "attributes": [{"key1":"val1"},{"key2":"val2"}]
      },
      "response": {
        "list":[
            {"item1":"name","price":1.00,"tax":0.055},
            {"item2":"name","price":10.00,"tax":0.55},
            {"item3":"name","price":100.00,"tax":5.5}
          ]
      },
      "timing": 200
    },
    {
      "method": "POST",
      "url": "https://myservices.foo/backend3",
      "reqeust":{
          "body": { 
            "userinfo": [{"key1":"val1"},{"key2":"val2"}]
          }
      },
      "response": {
          "success" : true
      },
      "timing": 220
    }
  ]
}

 

 

 

I am trying to list this information in one table.  so that I would have a set of columns for my request followed by a set of columns for each of the backend services in the array.  

 

Labels (2)
0 Karma

to4kawa
Ultra Champion

|spath backEndCalls{} output=backEndCalls|stats count by backEndCalls | spath input=backEndCalls | fields - count

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...