user2939034
user2939034

Reputation: 1

In TICKscript (Kapacitor), how will you split the string?

For example, var str1 = "abc.test.com:8080"

I need something as follows,

var splitted = split(str1,":")

var only_hostname = splitted[0] //will give abc.test.com*

How can we actually achieve the same in TICKscript?

Upvotes: 0

Views: 436

Answers (1)

arturo mondelo
arturo mondelo

Reputation: 46

You could define the variable as a regex...Something like var str1 =~ /abc.test.com/ so you will aggregate by host independant of ports...

I never need exactly your use case, but maybe in the go specs you could find what you need!

Upvotes: 0

Related Questions