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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...