<?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 Splunk truncating XML in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-truncating-XML/m-p/104736#M5921</link>
    <description>&lt;P&gt;Hi All,&lt;BR /&gt;
I'm having a play with webservices at the moment and I'm using a python script to retrieve weather information from a an online site.  My python script outputs the following at the moment : -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-16"?&amp;gt;
&amp;lt;CurrentWeather&amp;gt;
  &amp;lt;Location&amp;gt;Dubbo, Australia (YSDU) 32-12S 148-34E 275M&amp;lt;/Location&amp;gt;
  &amp;lt;Time&amp;gt;Oct 27, 2012 - 01:00 AM EDT / 2012.10.27 0500 UTC&amp;lt;/Time&amp;gt;
  &amp;lt;Wind&amp;gt; from the SW (230 degrees) at 13 MPH (11 KT):0&amp;lt;/Wind&amp;gt;
  &amp;lt;Visibility&amp;gt; greater than 7 mile(s):0&amp;lt;/Visibility&amp;gt;
  &amp;lt;Temperature&amp;gt; 75 F (24 C)&amp;lt;/Temperature&amp;gt;
  &amp;lt;DewPoint&amp;gt; 24 F (-4 C)&amp;lt;/DewPoint&amp;gt;
  &amp;lt;RelativeHumidity&amp;gt; 15%&amp;lt;/RelativeHumidity&amp;gt;
  &amp;lt;Pressure&amp;gt; 29.97 in. Hg (1015 hPa)&amp;lt;/Pressure&amp;gt;
  &amp;lt;Status&amp;gt;Success&amp;lt;/Status&amp;gt;
&amp;lt;/CurrentWeather&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, when I run it in splunk, my location and time tags are truncated to the comma. So i'll only see &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;?xml version="1.0" encoding="utf-16"?&amp;gt;
    &amp;lt;CurrentWeather&amp;gt;
      &amp;lt;Location&amp;gt;Dubbo
      &amp;lt;Time&amp;gt;Oct 27
      &amp;lt;Wind&amp;gt; from the SW (230 degrees) at 13 MPH (11 KT):0&amp;lt;/Wind&amp;gt;
      &amp;lt;Visibility&amp;gt; greater than 7 mile(s):0&amp;lt;/Visibility&amp;gt;
      &amp;lt;Temperature&amp;gt; 75 F (24 C)&amp;lt;/Temperature&amp;gt;
      &amp;lt;DewPoint&amp;gt; 24 F (-4 C)&amp;lt;/DewPoint&amp;gt;
      &amp;lt;RelativeHumidity&amp;gt; 15%&amp;lt;/RelativeHumidity&amp;gt;
      &amp;lt;Pressure&amp;gt; 29.97 in. Hg (1015 hPa)&amp;lt;/Pressure&amp;gt;
      &amp;lt;Status&amp;gt;Success&amp;lt;/Status&amp;gt;
    &amp;lt;/CurrentWeather&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;xmlkv also doesn't seem to be finding any of the other tags, but can I assume it's due to the errors from the first 2 tags?&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Sat, 27 Oct 2012 06:10:23 GMT</pubDate>
    <dc:creator>stephenho</dc:creator>
    <dc:date>2012-10-27T06:10:23Z</dc:date>
    <item>
      <title>Splunk truncating XML</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-truncating-XML/m-p/104736#M5921</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;
I'm having a play with webservices at the moment and I'm using a python script to retrieve weather information from a an online site.  My python script outputs the following at the moment : -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-16"?&amp;gt;
&amp;lt;CurrentWeather&amp;gt;
  &amp;lt;Location&amp;gt;Dubbo, Australia (YSDU) 32-12S 148-34E 275M&amp;lt;/Location&amp;gt;
  &amp;lt;Time&amp;gt;Oct 27, 2012 - 01:00 AM EDT / 2012.10.27 0500 UTC&amp;lt;/Time&amp;gt;
  &amp;lt;Wind&amp;gt; from the SW (230 degrees) at 13 MPH (11 KT):0&amp;lt;/Wind&amp;gt;
  &amp;lt;Visibility&amp;gt; greater than 7 mile(s):0&amp;lt;/Visibility&amp;gt;
  &amp;lt;Temperature&amp;gt; 75 F (24 C)&amp;lt;/Temperature&amp;gt;
  &amp;lt;DewPoint&amp;gt; 24 F (-4 C)&amp;lt;/DewPoint&amp;gt;
  &amp;lt;RelativeHumidity&amp;gt; 15%&amp;lt;/RelativeHumidity&amp;gt;
  &amp;lt;Pressure&amp;gt; 29.97 in. Hg (1015 hPa)&amp;lt;/Pressure&amp;gt;
  &amp;lt;Status&amp;gt;Success&amp;lt;/Status&amp;gt;
&amp;lt;/CurrentWeather&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, when I run it in splunk, my location and time tags are truncated to the comma. So i'll only see &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;?xml version="1.0" encoding="utf-16"?&amp;gt;
    &amp;lt;CurrentWeather&amp;gt;
      &amp;lt;Location&amp;gt;Dubbo
      &amp;lt;Time&amp;gt;Oct 27
      &amp;lt;Wind&amp;gt; from the SW (230 degrees) at 13 MPH (11 KT):0&amp;lt;/Wind&amp;gt;
      &amp;lt;Visibility&amp;gt; greater than 7 mile(s):0&amp;lt;/Visibility&amp;gt;
      &amp;lt;Temperature&amp;gt; 75 F (24 C)&amp;lt;/Temperature&amp;gt;
      &amp;lt;DewPoint&amp;gt; 24 F (-4 C)&amp;lt;/DewPoint&amp;gt;
      &amp;lt;RelativeHumidity&amp;gt; 15%&amp;lt;/RelativeHumidity&amp;gt;
      &amp;lt;Pressure&amp;gt; 29.97 in. Hg (1015 hPa)&amp;lt;/Pressure&amp;gt;
      &amp;lt;Status&amp;gt;Success&amp;lt;/Status&amp;gt;
    &amp;lt;/CurrentWeather&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;xmlkv also doesn't seem to be finding any of the other tags, but can I assume it's due to the errors from the first 2 tags?&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Sat, 27 Oct 2012 06:10:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-truncating-XML/m-p/104736#M5921</guid>
      <dc:creator>stephenho</dc:creator>
      <dc:date>2012-10-27T06:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk truncating XML</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-truncating-XML/m-p/104737#M5922</link>
      <description>&lt;P&gt;I don't really understand how you "run it in Splunk". It would be helpful if you explained what you're doing and exactly where you're seeing this.&lt;/P&gt;

&lt;P&gt;Also, is your Python script really outputting in utf-16 encoding?&lt;/P&gt;

&lt;P&gt;Also, &lt;CODE&gt;spath&lt;/CODE&gt; is preferred over &lt;CODE&gt;xmlkv&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Oct 2012 16:30:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-truncating-XML/m-p/104737#M5922</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2012-10-27T16:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk truncating XML</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-truncating-XML/m-p/104738#M5923</link>
      <description>&lt;P&gt;Hi Gkanapathy,&lt;/P&gt;

&lt;P&gt;I wrote a python script, and put an entry into the commands.conf file.  &lt;/P&gt;

&lt;P&gt;And when I run that script in command line, I get the first output as mentioned in my original post.&lt;/P&gt;

&lt;P&gt;However, when I run it in splunk via&lt;/P&gt;

&lt;P&gt;|script python findWeather dubbo Australia&lt;/P&gt;

&lt;P&gt;I get the truncated version of the of the XML on the first 2 tags.  Due to line restrictions, I'll paste the code of my python script in the next comment.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Sat, 27 Oct 2012 21:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-truncating-XML/m-p/104738#M5923</guid>
      <dc:creator>stephenho</dc:creator>
      <dc:date>2012-10-27T21:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk truncating XML</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-truncating-XML/m-p/104739#M5924</link>
      <description>&lt;P&gt;import sys&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if len(sys.argv) != 3:
    print "Usage: sysarglimi.py [city] [country]"
    sys.exit(0)

cityf = sys.argv[1]
countryf = sys.argv[2]

from suds.client import Client
url = "http://www.webservicex.net/globalweather.asmx?WSDL"
client = Client(url)
result2 = client.service.GetWeather(cityf,countryf)
print result2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Oct 2012 21:47:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-truncating-XML/m-p/104739#M5924</guid>
      <dc:creator>stephenho</dc:creator>
      <dc:date>2012-10-27T21:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk truncating XML</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-truncating-XML/m-p/104740#M5925</link>
      <description>&lt;P&gt;Okay, custom search commands and scripts don't work this way. You are expected to output in CSV format here, with the raw data in the field &lt;CODE&gt;_raw&lt;/CODE&gt;. This is &lt;EM&gt;not&lt;/EM&gt; like with scripted inputs, where you would simply write the raw to stdout (as you did here). You should probably look at the docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/WriteaPythonsearchcommand"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/WriteaPythonsearchcommand&lt;/A&gt; as well as the shipped scripts in &lt;CODE&gt;$SPLUNK_HOME/etc/apps/search/bin&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2012 16:45:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-truncating-XML/m-p/104740#M5925</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2012-10-28T16:45:45Z</dc:date>
    </item>
  </channel>
</rss>

