<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Do not display certain elements of a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615973#M214050</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190794"&gt;@johnhuang&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I just tested your solution and it is almost perfect, I just adjusted the MVINDEX (which I discover as a function, I learn about it every day) so that in addition to taking the user to -1, it takes also the closing time at -1. My command looks like:&lt;BR /&gt;index="oncall_prod" routingKey=*&lt;BR /&gt;| search currentPhase=RESOLVED&lt;BR /&gt;| dedup incidentNumber&lt;BR /&gt;| rename transitions{}.at as ack, transitions{}.by as Utilisateur, incidentNumber as N_Incident, entityDisplayName as Nom_Incident&lt;BR /&gt;&lt;STRONG&gt;| eval ack=MVINDEX(ack, -1)&lt;/STRONG&gt;&lt;BR /&gt;| eval Utilisateur=MVINDEX(Utilisateur, -1)&lt;BR /&gt;| eval create_time = strptime(startTime,"%Y-%m-%dT%H:%M:%SZ")&lt;BR /&gt;| eval ack_time = strptime(ack,"%Y-%m-%dT%H:%M:%SZ")&lt;BR /&gt;| eval temps_ack = tostring((ack_time - create_time), "duration")&lt;BR /&gt;| eval create_time=((create_time)+7200)&lt;BR /&gt;| eval ack_time=((ack_time)+7200)&lt;BR /&gt;| eval Debut_Incident = strftime(create_time,"%Y-%m-%d %H:%M:%S ")&lt;BR /&gt;| eval Traitement = strftime(ack_time,"%Y-%m-%d %H:%M:%S ")&lt;BR /&gt;| eval temps_ack = strftime(strptime(temps_ack, "%H:%M:%S"), "%H:%M:%S ")&lt;BR /&gt;| rename temps_ack as Temps_Traitement&lt;BR /&gt;| table N_Incident, Nom_Incident, Debut_Incident, Traitement, Temps_Traitement, Utilisateur&lt;/P&gt;&lt;P&gt;And it does not impact when I switch my same request with ACKED (instead of RESOLVED). Thank you for your help.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Rajaion&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2022 12:12:29 GMT</pubDate>
    <dc:creator>Rajaion</dc:creator>
    <dc:date>2022-10-05T12:12:29Z</dc:date>
    <item>
      <title>Do not display certain elements of a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615787#M213986</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;
&lt;P&gt;I am having a problem with a dashboard that I am setting up based on Splunk OnCall data, in order to see the acknowledgment and resolution times for alerts.&lt;/P&gt;
&lt;P&gt;In order to see the resolution period of my alerts, I made a dashboard that shows me the right information:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rajaion_0-1664875376844.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21859i2784A1F2117F8386/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rajaion_0-1664875376844.png" alt="Rajaion_0-1664875376844.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;However, I sometimes have lines with two users displayed, and no more dates:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rajaion_1-1664875401821.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21860iC2DD988DF827CF8E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rajaion_1-1664875401821.png" alt="Rajaion_1-1664875401821.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Looking at the alert in detail, I see that the item I retrieve contains two pieces of information:&lt;BR /&gt;One for the user who acknowledged the alert, and one for the resolution, always done by the "SYSTEM" user:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rajaion_2-1664875512525.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21861i8F5D6662297F2683/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rajaion_2-1664875512525.png" alt="Rajaion_2-1664875512525.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In the construction of my research, I cannot "impose" to keep only the "SYSTEM" user when I display the resolved alerts (in the context of acknowledged alerts, it is simpler because I filter the states ACKED upstream):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="oncall_prod" routingKey=*
| search currentPhase=RESOLVED 
| dedup incidentNumber
| rename transitions{}.at as ack, transitions{}.by as Utilisateur, incidentNumber as N_Incident, entityDisplayName as Nom_Incident
| eval create_time = strptime(startTime,"%Y-%m-%dT%H:%M:%SZ") 
| eval ack_time = strptime(ack,"%Y-%m-%dT%H:%M:%SZ")
| eval temps_ack = tostring((ack_time - create_time), "duration")
| eval create_time=((create_time)+7200)
| eval ack_time=((ack_time)+7200)
| eval Debut_Incident = strftime(create_time,"%Y-%m-%d %H:%M:%S ")
| eval Traitement = strftime(ack_time,"%Y-%m-%d %H:%M:%S ")
| eval temps_ack = strftime(strptime(temps_ack, "%H:%M:%S"), "%H:%M:%S ")
| rename temps_ack as Temps_Traitement
| table N_Incident, Nom_Incident, Debut_Incident, Traitement, Temps_Traitement, Utilisateur&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have any idea what changes I need to make to successfully see only the user linked to the resolution? I'm sure it's a stupid thing but I can't quite put my finger on it.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Rajaion&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 13:37:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615787#M213986</guid>
      <dc:creator>Rajaion</dc:creator>
      <dc:date>2022-10-04T13:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Do not display certain elements of a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615849#M214003</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241114"&gt;@Rajaion&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&lt;/P&gt;&lt;P&gt;you sometimes have in the user name two values "system" and another one in the same event.&lt;/P&gt;&lt;P&gt;Now you want to take only the values "SYSTEM", is it correct?&lt;/P&gt;&lt;P&gt;if this is your requirement, you could add mvexpand utilisateur and filter for this field, please try someting like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="oncall_prod" routingKey=*
| search currentPhase=RESOLVED 
| dedup incidentNumber
| rename transitions{}.at as ack, transitions{}.by as Utilisateur, incidentNumber as N_Incident, entityDisplayName as Nom_Incident
| eval create_time = strptime(startTime,"%Y-%m-%dT%H:%M:%SZ") 
| eval ack_time = strptime(ack,"%Y-%m-%dT%H:%M:%SZ")
| eval temps_ack = tostring((ack_time - create_time), "duration")
| eval create_time=((create_time)+7200)
| eval ack_time=((ack_time)+7200)
| eval Debut_Incident = strftime(create_time,"%Y-%m-%d %H:%M:%S ")
| eval Traitement = strftime(ack_time,"%Y-%m-%d %H:%M:%S ")
| eval temps_ack = strftime(strptime(temps_ack, "%H:%M:%S"), "%H:%M:%S ")
| rename temps_ack as Temps_Traitement
| mvexpand Utilisateur
| search Utilisateur=SYSTEM
| table N_Incident, Nom_Incident, Debut_Incident, Traitement, Temps_Traitement, Utilisateur&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 16:06:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615849#M214003</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-04T16:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Do not display certain elements of a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615857#M214009</link>
      <description>&lt;P&gt;Looks like you're dealing with multivalue fields and you wanted to extract the first value of&amp;nbsp;&amp;nbsp;'transitions{}.at' and the last value of 'transitions{}.by'.&lt;/P&gt;&lt;P&gt;See below in RED:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;SPAN&gt;index="oncall_prod" routingKey=*&lt;BR /&gt;&lt;/SPAN&gt;| search currentPhase=RESOLVED &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| dedup incidentNumber&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| rename transitions{}.at as ack, transitions{}.by as Utilisateur, incidentNumber as N_Incident, entityDisplayName as Nom_Incident&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;| eval ack=MVINDEX(ack, 0)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;| eval Utilisateur=MVINDEX(Utilisateur, -1)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| eval create_time = strptime(startTime,"%Y-%m-%dT%H:%M:%SZ") &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| eval ack_time = strptime(ack,"%Y-%m-%dT%H:%M:%SZ")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| eval temps_ack = tostring((ack_time - create_time), "duration")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| eval create_time=((create_time)+7200)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| eval ack_time=((ack_time)+7200)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| eval Debut_Incident = strftime(create_time,"%Y-%m-%d %H:%M:%S ")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| eval Traitement = strftime(ack_time,"%Y-%m-%d %H:%M:%S ")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| eval temps_ack = strftime(strptime(temps_ack, "%H:%M:%S"), "%H:%M:%S ")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| rename temps_ack as Temps_Traitement&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;| table N_Incident, Nom_Incident, Debut_Incident, Traitement, Temps_Traitement, Utilisateur&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 16:50:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615857#M214009</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-10-04T16:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Do not display certain elements of a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615973#M214050</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190794"&gt;@johnhuang&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I just tested your solution and it is almost perfect, I just adjusted the MVINDEX (which I discover as a function, I learn about it every day) so that in addition to taking the user to -1, it takes also the closing time at -1. My command looks like:&lt;BR /&gt;index="oncall_prod" routingKey=*&lt;BR /&gt;| search currentPhase=RESOLVED&lt;BR /&gt;| dedup incidentNumber&lt;BR /&gt;| rename transitions{}.at as ack, transitions{}.by as Utilisateur, incidentNumber as N_Incident, entityDisplayName as Nom_Incident&lt;BR /&gt;&lt;STRONG&gt;| eval ack=MVINDEX(ack, -1)&lt;/STRONG&gt;&lt;BR /&gt;| eval Utilisateur=MVINDEX(Utilisateur, -1)&lt;BR /&gt;| eval create_time = strptime(startTime,"%Y-%m-%dT%H:%M:%SZ")&lt;BR /&gt;| eval ack_time = strptime(ack,"%Y-%m-%dT%H:%M:%SZ")&lt;BR /&gt;| eval temps_ack = tostring((ack_time - create_time), "duration")&lt;BR /&gt;| eval create_time=((create_time)+7200)&lt;BR /&gt;| eval ack_time=((ack_time)+7200)&lt;BR /&gt;| eval Debut_Incident = strftime(create_time,"%Y-%m-%d %H:%M:%S ")&lt;BR /&gt;| eval Traitement = strftime(ack_time,"%Y-%m-%d %H:%M:%S ")&lt;BR /&gt;| eval temps_ack = strftime(strptime(temps_ack, "%H:%M:%S"), "%H:%M:%S ")&lt;BR /&gt;| rename temps_ack as Temps_Traitement&lt;BR /&gt;| table N_Incident, Nom_Incident, Debut_Incident, Traitement, Temps_Traitement, Utilisateur&lt;/P&gt;&lt;P&gt;And it does not impact when I switch my same request with ACKED (instead of RESOLVED). Thank you for your help.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Rajaion&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 12:12:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615973#M214050</guid>
      <dc:creator>Rajaion</dc:creator>
      <dc:date>2022-10-05T12:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Do not display certain elements of a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615975#M214051</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for your solution. I tested it but I end up with a problem, it is that I do not see the dates, I have the impression that it just removes the other name to keep only SYSTEM, which is good in itself but does not take into account the solving time and the calculation that goes behind it:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rajaion_0-1664972303961.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21897i070523AB3AA57A89/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rajaion_0-1664972303961.png" alt="Rajaion_0-1664972303961.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;With the other solution, I manage to recover the processing time. However, I keep your solution that I will apply to other of my dashboards.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 12:18:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615975#M214051</guid>
      <dc:creator>Rajaion</dc:creator>
      <dc:date>2022-10-05T12:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Do not display certain elements of a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615989#M214056</link>
      <description>&lt;P&gt;&lt;STRONG&gt;"| eval ack=MVINDEX(ack, -1)" &lt;/STRONG&gt;gives you the last value of the multivalue field which in this case is the system resolved time.&lt;/P&gt;&lt;P&gt;If the multivalue field consistently contains 2 values, you can use &lt;STRONG&gt;MVINDEX(ack, 0)&lt;/STRONG&gt; to get the first value and&lt;STRONG&gt;&amp;nbsp;MVINDEX(ack, 1)&amp;nbsp;&lt;/STRONG&gt;to extract the second (or last) value. However in cases where the number of values are unknown or inconsistent and you want to extract the last value, then using &lt;STRONG&gt;MVINDEX(ack, -1) &lt;/STRONG&gt;does the trick&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 13:39:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615989#M214056</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-10-05T13:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Do not display certain elements of a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615991#M214057</link>
      <description>&lt;P&gt;Thanks for the precision. In my case, the last value will necessarily be that of the resolution (and the only other, that of the potential acknowledgment) so it fits exactly in my case. But I take good note of the function of "MVINDEX" for other needs.&lt;/P&gt;&lt;P&gt;Rajaion&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 13:45:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Do-not-display-certain-elements-of-a-search/m-p/615991#M214057</guid>
      <dc:creator>Rajaion</dc:creator>
      <dc:date>2022-10-05T13:45:35Z</dc:date>
    </item>
  </channel>
</rss>

