Remove substring in Query Results

Didn’t find an answer so sorry if it already has been answered.
I’m querying Loki and it returns lines like
…action=query responsetime=240.4sec
…action=query responsetime=13.4sec

Trying to make a Dashboard showing total time spent querying. Is there a way to remove “sec” from the responsetime and convert it to a number?

maybe play around with regex?
=(\d+).(\d+)