Splunk Search

splunk replace the content of viz after search query execution completed

AnilPujar
Path Finder

I need to remove the ": 1" in content "CHG0014888 (N): 1"

HTML Content:

<tr>
  <td rowspan="2"></td>
  <td rowspan="2"></td>
  <td rowspan="2"></td>
  <td rowspan="2"></td>
  <td rowspan="2"></td>
  <td class="fc-event-container">
    <a class="fc-day-grid-event fc-h-event fc-event fc-start fc-end" style="background-color:#0e776d;border-color:#0e776d">
      <div class="fc-content"><span class="fc-time">4a</span> <span class="fc-title">CHG0014634 (N): 1</span></div>
    </a>
  </td>
  <td rowspan="2"></td>
</tr>


<tr>
  <td class="fc-event-container">
    <a class="fc-day-grid-event fc-h-event fc-event fc-start fc-end" style="background-color:#e2c188;border-color:#e2c188">
      <div class="fc-content"><span class="fc-time">10a</span> <span class="fc-title">CHG0014888 (N): 1</span></div>
    </a>
  </td>
</tr>

JQuery: which is working in js fiddle but not in splunk

    $('.fc-title').html(
        function (index, oldHtml) {
            return oldHtml.replace(": 1", "");
        }
     );

The below background color change function is working but the above content removal function not working.

   require([
       'underscore',
       'jquery',
       'splunkjs/mvc',
       'splunkjs/mvc/simpleform/formutils',
       'splunkjs/mvc/simplexml/ready!'
       ], function(_, $, mvc, FormUtils) {

    $( document ).bind('DOMSubtreeModified',function() {
            $('span:contains("(S)")').closest('.fc-day-grid-event').addClass('std_chg_type');
            $('span:contains("(N)")').closest('.fc-day-grid-event').addClass('norm_chg_type');
            $('span:contains("(E)")').closest('.fc-day-grid-event').addClass('emerg_chg_type');
     });

     $( document ).ready(function() {
             $('.fc-title').html(
               function (index, oldHtml) {
              return oldHtml.replace(": 1", "");
             });
      });
      });
0 Karma

AnilPujar
Path Finder

The above customization i'm doing in custom calendar visualization.

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...