Splunk Dev

How can I concatenate multiple variables in SplunkJS script?

clement
Explorer

How can I concatenate multiple variables in SplunkJS script?

e.g:
var date = Date.now();
var alertid = 12345;
var filename = date.concat("_").concat(alertid).concat(".txt");

do I need to import any library?

0 Karma
1 Solution

hardikJsheth
Motivator

You can use + for concatenating two strings.

newlabel = newlabel +"<font color=\"red\" face=\"verdana\">*</font>";

View solution in original post

0 Karma

hardikJsheth
Motivator

You can use + for concatenating two strings.

newlabel = newlabel +"<font color=\"red\" face=\"verdana\">*</font>";
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...