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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...