<?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: How to set data model to return a List instead of a String field? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-set-data-model-to-return-a-List-instead-of-a-String-field/m-p/423096#M74316</link>
    <description>&lt;P&gt;Unfortunately, what I wanted to do above in Splunk is not possible.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jun 2018 02:22:25 GMT</pubDate>
    <dc:creator>emiliavanderwer</dc:creator>
    <dc:date>2018-06-05T02:22:25Z</dc:date>
    <item>
      <title>How to set data model to return a List instead of a String field?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-set-data-model-to-return-a-List-instead-of-a-String-field/m-p/423095#M74315</link>
      <description>&lt;P&gt;As shown in the screenshot below, sometimes our data has one entry for the &lt;CODE&gt;geo&lt;/CODE&gt; field and sometimes it has multiple entries for this same field. When our C# Web App issues a query to Splunk and gets results back, we use the Newtonsoft.Json library to help deserialize the JSON result into a C# object.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5061i34D3BCB683EA48E4/image-size/large?v=v2&amp;amp;px=999" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;However, the issue is that when there is only one &lt;CODE&gt;geo&lt;/CODE&gt;, Splunk returns a &lt;CODE&gt;String&lt;/CODE&gt; object; yet when there are multiple &lt;CODE&gt;geo&lt;/CODE&gt; values, then Splunk returns a &lt;CODE&gt;List&amp;lt;String&amp;gt;&lt;/CODE&gt;. Since C# &amp;amp; its Newtonsoft.Json library are strongly typed, I would have to create two C# objects: one that handles &lt;CODE&gt;geo&lt;/CODE&gt; as a &lt;CODE&gt;String&lt;/CODE&gt; and another that handles &lt;CODE&gt;geo&lt;/CODE&gt; as a &lt;CODE&gt;List&amp;lt;String&amp;gt;&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Thus, my question is: Is there a way to force Splunk to always return &lt;CODE&gt;List&amp;lt;String&amp;gt;&lt;/CODE&gt; for the &lt;CODE&gt;geo&lt;/CODE&gt; field, even if the length of the list is only one?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 00:40:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-set-data-model-to-return-a-List-instead-of-a-String-field/m-p/423095#M74315</guid>
      <dc:creator>emiliavanderwer</dc:creator>
      <dc:date>2018-05-30T00:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to set data model to return a List instead of a String field?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-set-data-model-to-return-a-List-instead-of-a-String-field/m-p/423096#M74316</link>
      <description>&lt;P&gt;Unfortunately, what I wanted to do above in Splunk is not possible.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 02:22:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-set-data-model-to-return-a-List-instead-of-a-String-field/m-p/423096#M74316</guid>
      <dc:creator>emiliavanderwer</dc:creator>
      <dc:date>2018-06-05T02:22:25Z</dc:date>
    </item>
  </channel>
</rss>

