<?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: Pie Chart AppendCol Data in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-AppendCol-Data/m-p/515200#M34443</link>
    <description>&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your reply, I will take a look at the website your provided.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However when I try your search I am getting the following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error in 'stats' command: The eval expression for dynamic field 'eval(match(pluginText,"*Credentialed checks : no*"))' is invalid. Error='Regex: quantifier does not follow a repeatable item'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Rick&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Aug 2020 12:40:10 GMT</pubDate>
    <dc:creator>fbond_diligent</dc:creator>
    <dc:date>2020-08-20T12:40:10Z</dc:date>
    <item>
      <title>Pie Chart AppendCol Data</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-AppendCol-Data/m-p/514685#M34395</link>
      <description>&lt;P&gt;I have successfully used appendcol to gather percentage of successful and failed scans. I would like to make this data into a pie chart for my dashboard.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I click visualization-&amp;gt; pie chart it is all one color.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my search&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="secops" sourcetype="tenable:sc:vuln" plugin_id=19506 pluginText!="*Host_Scan*" | dedup ip | search pluginText="*Credentialed checks : no*" | stats count(plugin_id) as failed_scans | appendcols [search index="secops" sourcetype="tenable:sc:vuln" plugin_id=19506 pluginText!="*Host_Scan*" | dedup ip | search pluginText="*Credentialed checks : yes*" | stats count(plugin_id) as successful_scans] | eval total_scans=(failed_scans+successful_scans) | eval failed_percent=(failed_scans/total_scans*100) | eval failed_percent=round(failed_percent,2) | eval success_percent=(successful_scans/total_scans*100) | eval success_percent=round(success_percent,2) | table success_percent failed_percent&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advanced.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 12:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-AppendCol-Data/m-p/514685#M34395</guid>
      <dc:creator>fbond_diligent</dc:creator>
      <dc:date>2020-08-18T12:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart AppendCol Data</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-AppendCol-Data/m-p/515128#M34435</link>
      <description>&lt;P&gt;&lt;STRONG&gt;[Updated]&lt;/STRONG&gt;&lt;BR /&gt;Corrected typo for match() condition which does not need *&lt;/P&gt;&lt;P&gt;___________________________&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225149"&gt;@fbond_diligent&lt;/a&gt;&amp;nbsp; as your final pipe if you add transpose command it should show Pie chart (convert result columns to rows).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| transpose&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, there are a lot of performance steps that you need to adopt.&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Search/Writebettersearches" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.5/Search/Writebettersearches&lt;/A&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Filter only required events from index based on pluginText as yes and no.&lt;/LI&gt;&lt;LI&gt;Perform stats using specific fields to deduplicate instead dedup with all the fields.&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Avoid subsearch as it introduces sub-search limitations (which may drop events if you hit limit).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Chain eval as single eval for performance and simple code.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="secops" sourcetype="tenable:sc:vuln" plugin_id=19506 pluginText!="*Host_Scan*" pluginText IN ("*Credentialed checks : yes*","*Credentialed checks : no*") 
| stats count as total_scans count(eval(match(pluginText,"Credentialed checks : no"))) as failed_scans count(eval(match(pluginText,"Credentialed checks : yes"))) as successful_scans by ip 
| stats sum(*_scans) as *_scans 
| eval failed_percent=round((failed_scans/total_scans*100),2), success_percent=round((success_percent/total_scans*100),2) 
| fields success_percent failed_percent 
| transpose 0 header_field="status" 
| rename "row 1" as percent&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 15:44:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-AppendCol-Data/m-p/515128#M34435</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-08-21T15:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart AppendCol Data</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-AppendCol-Data/m-p/515200#M34443</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your reply, I will take a look at the website your provided.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However when I try your search I am getting the following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error in 'stats' command: The eval expression for dynamic field 'eval(match(pluginText,"*Credentialed checks : no*"))' is invalid. Error='Regex: quantifier does not follow a repeatable item'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Rick&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2020 12:40:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-AppendCol-Data/m-p/515200#M34443</guid>
      <dc:creator>fbond_diligent</dc:creator>
      <dc:date>2020-08-20T12:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart AppendCol Data</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-AppendCol-Data/m-p/515499#M34467</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225149"&gt;@fbond_diligent&lt;/a&gt;&amp;nbsp;sorry for the copy paste issue. match() condition is regex based. So * is not required. Please check updated SPL.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 15:45:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-AppendCol-Data/m-p/515499#M34467</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-08-21T15:45:21Z</dc:date>
    </item>
  </channel>
</rss>

