Splunk Search

Why am I getting "TypeError: e.replace is not a function" using SearchManager with eval in the search?

vikassanap2011
New Member
new SearchManager({
                id: "mysearch1",
                earliest_time: "-24h@h",
                latest_time: "now",
                search: "openstack::* node::* command=w |dedup node|eval critical = if( load2 > 1.25,load2,0)|table node load2 critical",
            });

Console error:

TypeError: e.replace is not a function


...ngToFieldList(e))},s=function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}...
0 Karma

koshyk
Super Champion

I guess you got a "comma" after the "search" param, thus the function not ending properly

0 Karma

vganjare
Builder

Try using Following code:

new SearchManager({
     id: "mysearch1",
     earliest_time: "-24h@h",
     latest_time: "now",
     search: "openstack::* node::* command=w |dedup node|eval critical = if( load2 > 1.25,load2,0)|table node load2 critical"
 });

Please note: Removed the last comma (just after search string).

Thanks!!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...