<?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: SVG vizualization does not generate if there is no data found in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/SVG-vizualization-does-not-generate-if-there-is-no-data-found/m-p/383973#M46705</link>
    <description>&lt;P&gt;Good catch and workaround.&lt;/P&gt;

&lt;P&gt;I'll need to dig into how to fix this the next time I get to look at the code behind the SVG app. &lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2018 20:52:49 GMT</pubDate>
    <dc:creator>msivill_splunk</dc:creator>
    <dc:date>2018-11-13T20:52:49Z</dc:date>
    <item>
      <title>SVG vizualization does not generate if there is no data found</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/SVG-vizualization-does-not-generate-if-there-is-no-data-found/m-p/383971#M46703</link>
      <description>&lt;P&gt;tokens that are passed to the SVG viz xml need to be populated else it will be blank &amp;amp; u will see SVG Error.&lt;/P&gt;

&lt;P&gt;Usually in other viz you will see no data found, but here you will get a SVG error text.&lt;/P&gt;

&lt;P&gt;host=popeyeOtherEye does not exist i assume&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   index=_internal host=popeyeOtherEye
    | stats count 
    | eval KOLOR = case( count &amp;gt; 0,"limegreen",count ==0,"RED" ,true(),"orange")
    |eval svg_viz = "&amp;lt;?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?&amp;gt;
    &amp;lt;!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"&amp;gt;
    &amp;lt;svg viewBox=\"0 0 1200 250\" width=\"1200\" height=\"250\"&amp;gt;
       &amp;lt;style&amp;gt;
         .small { font: bold  11px Calibri; }
        .heavy { font: bold 20px Calibri; }
      &amp;lt;/style&amp;gt;   

      &amp;lt;rect x=\"0\" y=\"20\" rx=\"3\" ry=\"3\" width=\"90\" height=\"40\" style=\"fill:"+KOLOR+";stroke:black;stroke-width:2;opacity:1.0\" /&amp;gt; 

      &amp;lt;text x=\"10\" y=\"50\" fill=\"black\" style=\"opacity:0.8\"   class=\"heavy\"  &amp;gt;"+count+"&amp;lt;/text&amp;gt;
      &amp;lt;text x=\"0\" y=\"75\" fill=\"black\" style=\"opacity:0.8\"  class=\"small\" &amp;gt;_internal Count&amp;lt;/text&amp;gt;

    &amp;lt;/svg&amp;gt; 
    "
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Nov 2018 18:02:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/SVG-vizualization-does-not-generate-if-there-is-no-data-found/m-p/383971#M46703</guid>
      <dc:creator>stanwin</dc:creator>
      <dc:date>2018-11-13T18:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: SVG vizualization does not generate if there is no data found</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/SVG-vizualization-does-not-generate-if-there-is-no-data-found/m-p/383972#M46704</link>
      <description>&lt;P&gt;Posting this to help anyone that has similar issues. &lt;/P&gt;

&lt;P&gt;Although you probably would do this for even non svg vizualizations!&lt;/P&gt;

&lt;P&gt;use an eval with coalesce or whatever you prefer to set default catch all value for all the tokens passed to the svg viz xml..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
| stats count 
| eval count = coalesce(count,"0")
| eval KOLOR = case( count &amp;gt; 0,"limegreen",count ==0,"RED" ,true(),"orange")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6077i11C9EF02AE3DC05E/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 18:05:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/SVG-vizualization-does-not-generate-if-there-is-no-data-found/m-p/383972#M46704</guid>
      <dc:creator>stanwin</dc:creator>
      <dc:date>2018-11-13T18:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: SVG vizualization does not generate if there is no data found</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/SVG-vizualization-does-not-generate-if-there-is-no-data-found/m-p/383973#M46705</link>
      <description>&lt;P&gt;Good catch and workaround.&lt;/P&gt;

&lt;P&gt;I'll need to dig into how to fix this the next time I get to look at the code behind the SVG app. &lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 20:52:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/SVG-vizualization-does-not-generate-if-there-is-no-data-found/m-p/383973#M46705</guid>
      <dc:creator>msivill_splunk</dc:creator>
      <dc:date>2018-11-13T20:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: SVG vizualization does not generate if there is no data found</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/SVG-vizualization-does-not-generate-if-there-is-no-data-found/m-p/383974#M46706</link>
      <description>&lt;P&gt;Version 3.0.1 of the &lt;A href="https://splunkbase.splunk.com/app/3815/"&gt;Scalable Vector Graphics - Custom Visualization&lt;/A&gt; app has been updated to show different error messages.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;If there are no events from the query results then&lt;BR /&gt;
the standard "No results found" will&lt;BR /&gt;
be returned&lt;/LI&gt;
&lt;LI&gt;Errors with the svg_viz&lt;BR /&gt;
field not appearing in the query results or 
not having a value will return "SVG 
field error"&lt;/LI&gt;
&lt;LI&gt;Errors with bad SVG in&lt;BR /&gt;
svg_viz filed will return "SVG parse&lt;BR /&gt;
error"&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;While this does not solve the original issue it should help narrow down any potential issues quicker by identifying where the error may be.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 16:58:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/SVG-vizualization-does-not-generate-if-there-is-no-data-found/m-p/383974#M46706</guid>
      <dc:creator>msivill_splunk</dc:creator>
      <dc:date>2019-04-16T16:58:28Z</dc:date>
    </item>
  </channel>
</rss>

