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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...