<?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 extract fields with JSON values while creating a DB input in Splunk DB Connect? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341076#M41152</link>
    <description>&lt;P&gt;May be this happens because Splunk IFX uses comma(,) as a default delimiter to separate and extract fields but the JSON itself contains commas(,) , therefore the default regex which is generated separates the field when it encounters the first comma(,) . &lt;BR /&gt;
So to extract any JSON field, one has to edit the original regex and make any changes required to extract the entire JSON field instead of '[}'&lt;/P&gt;</description>
    <pubDate>Wed, 25 Oct 2017 05:45:28 GMT</pubDate>
    <dc:creator>gsrivastava</dc:creator>
    <dc:date>2017-10-25T05:45:28Z</dc:date>
    <item>
      <title>How to extract fields with JSON values while creating a DB input in Splunk DB Connect?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341072#M41148</link>
      <description>&lt;UL&gt;
&lt;LI&gt;I am creating a DB Input in DB Connect v3 &lt;/LI&gt;
&lt;LI&gt;My DB columns contains JSON values.&lt;/LI&gt;
&lt;LI&gt;I am getting correct raw data in Splunk, but on selecting Table mode, the field does not have correct values.
for ex, if the column name is status and the JSON it contains is : "[{"datasetId":1,"refreshStatus":16}]", then the field created in 
splunk is status but it only contains the value :   '[{'. &lt;/LI&gt;
&lt;LI&gt;All the rows in Splunk contains this same value '[{'&lt;/LI&gt;
&lt;LI&gt;May be Splunk is using double quote as a delimiter to separate fields, but the JSON itself contains the quotes.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 18 Sep 2017 09:34:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341072#M41148</guid>
      <dc:creator>gsrivastava</dc:creator>
      <dc:date>2017-09-18T09:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields with JSON values while creating a DB input in Splunk DB Connect?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341073#M41149</link>
      <description>&lt;P&gt;I am using DB Connect 2.4.0 with JSON data. A sample might be.&lt;/P&gt;

&lt;P&gt;"record":{"subfield1":"value1","subfield2","value2"}&lt;/P&gt;

&lt;P&gt;I use &lt;CODE&gt;"SELECT record['subfield1'] AS subfield1.. WHERE record['subfield'] IS NOT NULL&lt;/CODE&gt;" to get the value. &lt;/P&gt;

&lt;P&gt;And if subfield1 itself is JSONlike then I do something like &lt;CODE&gt;rex field=subfield1 "\"somefield\":(?&amp;lt;somefieldT&amp;gt;.*?)[,}]&lt;/CODE&gt;"  in order to get somefield out.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 00:13:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341073#M41149</guid>
      <dc:creator>burwell</dc:creator>
      <dc:date>2017-09-19T00:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields with JSON values while creating a DB input in Splunk DB Connect?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341074#M41150</link>
      <description>&lt;P&gt;Thanks @burwell for responding. But I want complete json in a field and handle that json in splunk itself. &lt;BR /&gt;
Sample JSON array is-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[  
   {  
      "set":3,
      "ids":[  
         9
      ],
      "status":12,
      "code":570,
      "idDetails":[  
         {  
            "id":9,
            "status":12,
            "code":570
         }
      ]
   },
   {  
      "set":1,
      "ids":[  
         5,
         8
      ],
      "status":21,
      "code":601,
      "idDetails":[  
         {  
            "id":5,
            "status":21,
            "code":601
         },
         {  
            "id":8,
            "status":21,
            "code":601
         }
      ]
   }
]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With this kind of nested JSON and with multiple keys having the same name, its not possible to extract all the fields in SQL itself. &lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 08:53:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341074#M41150</guid>
      <dc:creator>gsrivastava</dc:creator>
      <dc:date>2017-09-19T08:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields with JSON values while creating a DB input in Splunk DB Connect?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341075#M41151</link>
      <description>&lt;P&gt;Hello gsrivastava . I am seeing my fields with the JSON. Try &lt;CODE&gt;SELECT field&lt;/CODE&gt; and then do &lt;CODE&gt;| table field&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I am seeing {"key":"value,"key2":"value2"} etc.&lt;/P&gt;

&lt;P&gt;Maybe you can show your SELECT with LIMIT 1 and the output you get.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 01:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341075#M41151</guid>
      <dc:creator>burwell</dc:creator>
      <dc:date>2017-09-21T01:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields with JSON values while creating a DB input in Splunk DB Connect?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341076#M41152</link>
      <description>&lt;P&gt;May be this happens because Splunk IFX uses comma(,) as a default delimiter to separate and extract fields but the JSON itself contains commas(,) , therefore the default regex which is generated separates the field when it encounters the first comma(,) . &lt;BR /&gt;
So to extract any JSON field, one has to edit the original regex and make any changes required to extract the entire JSON field instead of '[}'&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 05:45:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341076#M41152</guid>
      <dc:creator>gsrivastava</dc:creator>
      <dc:date>2017-10-25T05:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields with JSON values while creating a DB input in Splunk DB Connect?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341077#M41153</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;

&lt;P&gt;Have you managed to solve this problem?&lt;BR /&gt;
I also have a similar issue, is it possible to grab the JSON data from a column in your DB input?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 14:21:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-fields-with-JSON-values-while-creating-a-DB-input/m-p/341077#M41153</guid>
      <dc:creator>stefan_d</dc:creator>
      <dc:date>2018-07-31T14:21:50Z</dc:date>
    </item>
  </channel>
</rss>

