Parsing Json in Akka for real time streaming

My input is a Json coming from Kafka Topic
{
a: val1,
b:val2,
c: val3
}

Now I want to process this Json based on any one attribute. For example: filter the Json based on any one attribute. Also the point to note is that the structure of Json may vary sometimes. Like there maybe 10 attributes in one case and 9 attributes in another case.

So what is the best way to parse any Json in my Akka application.

In my application I have used Circe Json library to parse .

def jsonKeyExtraction(input: String, path: String): Seq[String] = {
val parsedInput: Json = parse(input).getOrElse(Json.Null)
val pathValue: String = parsedInput.findAllByKey(path).head.toString
val listPathValue: Seq[String] = pathValue.substring(1, pathValue.length-1).split("\n").filter(_.nonEmpty)
val finalPathValue: Seq[String] = listPathValue.map(ele => {
ele.trim.replace(""", “”).replace(",", “”)
}).toList
finalPathValue
}

I call this function for my each incoming data. So is my application affected by this function. Like whether it is time consuming for my real time Akka application? Should I avoid these kind of functions or maybe it is too complex for my application?