03 Apr 2025 02:40 AM
In DQL, splitString and substring couldn't achieved what I want.
Before this, I can always try to be creative and use other kind of DQL function/command or manipulations and achieved what I want. But today there is just this one problem I couldn't solve, hence asking this question here.
In the Unix world, we can use awk, grep, sed, tail (or any combinations). It seems like it DQL there isn't this much freedom though.
Don't get me wrong, DQL is good and powerful for querying data in Grail, but when it comes to string manipulation it seems to be can be a bit lacking sometimes.
Anyway, the problem I'm facing is as below:
I want to extract the reason of pods not healthy as shown in the last column of screenshot below, how can I use DQL to extract the part before? (i.e to extract only the string before \\\"}]}\", \"{\\\"events ?)
Best Regards,
Wai Keat
04 Apr 2025 10:52 PM
You can use the parse command combined with a DPL pattern to extract the data you need into a new field.