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!

.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 ...

Introducing the 2024 SplunkTrust!

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