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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...