<?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: Command 'fields' is rewriting the column data in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Why-is-command-fields-rewriting-the-column-data/m-p/643447#M9468</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245257"&gt;@Shubhanker99&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Nothing obviously wrong in the SPL.&amp;nbsp; Could be a bug so next steps would be raising a support case with Splunk.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 May 2023 21:20:11 GMT</pubDate>
    <dc:creator>yeahnah</dc:creator>
    <dc:date>2023-05-15T21:20:11Z</dc:date>
    <item>
      <title>Why is command 'fields' rewriting the column data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-is-command-fields-rewriting-the-column-data/m-p/643312#M9465</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am facing an issue with the SPL of a dashboard panel. If you see the 2 figures, the SPL above the last 2-3 lines is same. When doing 'fields -' and removing the unnecessary fields, the correct data is being outputted. But when doing 'fields' to take just the required fields and then removing '_raw' with 'fields -', the values are being overwritten? Note that the field of 'workflow_username' has no issues and only 'totalScore' and 'percentage' fields are having this issue.&lt;/P&gt;
&lt;P&gt;Another thing to note that the 'totalScore' field is derived from other data using 'foreach' and 'eval' commands but I don't think this issue is because of that.&lt;/P&gt;
&lt;P&gt;Any help is appreciated. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Figure 1" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25376iE8CA88AA213C42EB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Figure 1" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Figure 1&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Figure 2" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25377i6BA74482C891C769/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Figure 2" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Figure 2&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 14:02:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-is-command-fields-rewriting-the-column-data/m-p/643312#M9465</guid>
      <dc:creator>Shubhanker99</dc:creator>
      <dc:date>2023-05-15T14:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Command 'fields' is rewriting the column data</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-is-command-fields-rewriting-the-column-data/m-p/643315#M9466</link>
      <description>&lt;P&gt;Hi&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245257"&gt;@Shubhanker99&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, that is strange.&amp;nbsp; If you provide all your SPL then that might help understand what the issue is.&lt;BR /&gt;&lt;BR /&gt;Or, in the case, as you only want to display 4 columns, just use the table command as this removes any _* columns by default, if not otherwise specified, e.g.&lt;/P&gt;&lt;PRE&gt;...&lt;BR /&gt;| table ts &lt;SPAN&gt;totalScore percentage &lt;/SPAN&gt;&lt;SPAN&gt;workflow_username &lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Hope this helps&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 04:48:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-is-command-fields-rewriting-the-column-data/m-p/643315#M9466</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-05-15T04:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Command 'fields' is rewriting the column data</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-is-command-fields-rewriting-the-column-data/m-p/643317#M9467</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/158935"&gt;@yeahnah&lt;/a&gt;&amp;nbsp;here is the edited SPL:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`setPrimaryIndex` sourcetype="A"
| search type=B
| rename workflow_step.inputs.input.value as _raw
| extract pairdelim="|", kvdelim="="
| rename _raw as workflow_step.inputs.input.value
| stats min(event_ts) as ts  values(workflow_step.inputs.workflow_name_input.value) as workflow_name values(workflow_step.inputs.total_questions_input.value) as total_questions values(workflow_step.inputs.input.value) as text values(workflow_step.inputs.workflow_executor_input.value) as workflow_executor by workflow_step.workflow_instance_id
| where workflow_name="C"
| rename text as _raw
| extract pairdelim="|", kvdelim="="
| rename _raw as text
| fields - workflow_step.workflow_instance_id status
| join type=outer workflow_executor [|`getChatUserLatest` | rename id as workflow_executor, name as workflow_username | eval workflow_executor="&amp;lt;@". workflow_executor . "&amp;gt;" | fields - _*| fields workflow_executor workflow_username]
| fields - workflow_executor text
| sort - ts
| eval ts=strftime(ts,"%F %T")
| rename workflow_name as workflow
| lookup D workflow OUTPUTNEW answer_sheet
| rename answer_sheet as _raw
| extract kvdelim="=" pairdelim=","
| eval totalScore = 0 
| foreach q*  [eval totalScore=if(lower(q&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;)=lower(a&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;), totalScore+1, totalScore)]
| search q1 = *
| dedup workflow_username sortby - _time
| eval percentage = round(totalScore/total_questions * 100)
| eval percentage = percentage + "%"
| fields - _raw total_questions workflow a* q*
| sort - totalScore&lt;/LI-CODE&gt;&lt;P&gt;As you said using 'table' will work but I want to know why 'field' command is behaving in this way.&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 05:17:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-is-command-fields-rewriting-the-column-data/m-p/643317#M9467</guid>
      <dc:creator>Shubhanker99</dc:creator>
      <dc:date>2023-05-15T05:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Command 'fields' is rewriting the column data</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-is-command-fields-rewriting-the-column-data/m-p/643447#M9468</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245257"&gt;@Shubhanker99&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Nothing obviously wrong in the SPL.&amp;nbsp; Could be a bug so next steps would be raising a support case with Splunk.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 21:20:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-is-command-fields-rewriting-the-column-data/m-p/643447#M9468</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-05-15T21:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Command 'fields' is rewriting the column data</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-is-command-fields-rewriting-the-column-data/m-p/643454#M9469</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/158935"&gt;@yeahnah&lt;/a&gt;&amp;nbsp;will do that.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 01:17:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-is-command-fields-rewriting-the-column-data/m-p/643454#M9469</guid>
      <dc:creator>Shubhanker99</dc:creator>
      <dc:date>2023-05-16T01:17:39Z</dc:date>
    </item>
  </channel>
</rss>

