<?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 the fields from JSON output and display as table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305320#M91655</link>
    <description>&lt;P&gt;Given the information in the comments above, try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "\"accountNumber13\"\s:\s\"(?P&amp;lt;accountNumber13&amp;gt;\d+)\"[\s\S]*\"siteId\"\s:\s\"(?P&amp;lt;siteId&amp;gt;\d+)\"[\s\S]*\"totalARBalance\"\s:\s\"(?P&amp;lt;totalARBalance&amp;gt;[\d\.]+)\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It can also be a basis for your future modifications. This worked on the data using regex101.com, so it should work in the rex command as I have provided. If you need it to run faster, there is a version that I did that needs the data to be pretty similar to the data you provided, but it only shaves of 20% of the steps, so it probably isn't worth it to make that modification.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2017 00:13:24 GMT</pubDate>
    <dc:creator>cpetterborg</dc:creator>
    <dc:date>2017-10-13T00:13:24Z</dc:date>
    <item>
      <title>How to extract the fields from JSON output and display as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305315#M91650</link>
      <description>&lt;P&gt;{&lt;BR /&gt;
    "ERROR_CODE" : "XXX-XXX-00000",&lt;BR /&gt;
    "ERROR_DESC" : "Success."&lt;BR /&gt;
  },&lt;BR /&gt;
  "accountBalances" : {&lt;BR /&gt;
    "accountNumber13" : "22222222222",&lt;BR /&gt;
    "siteId" : "200001005",&lt;BR /&gt;
    "siteCode" : "HRD",&lt;BR /&gt;
    "customerName" : "LiXX XXXXXX",&lt;BR /&gt;
    "serviceAddress" : "XXXXXXXXXX, VA XXXXX-4849  ",&lt;BR /&gt;
    "streetNumber" : "XXX",&lt;BR /&gt;
    "streetName" : "XXXXXX",&lt;BR /&gt;
    "city" : "CHESAPEAKE",&lt;BR /&gt;
    "state" : "VA",&lt;BR /&gt;
    "zip5" : "23320",&lt;BR /&gt;
    "homeTelephoneNumber" : "XXX 000-0000",&lt;BR /&gt;
    "acceptChecks" : "True",&lt;BR /&gt;
    "acceptCreditCards" : "True",&lt;BR /&gt;
    "pendingWODepositAmount" : "0.0",&lt;BR /&gt;
    "statementInfo" : [ {&lt;BR /&gt;
      "statementCode" : 1,&lt;BR /&gt;
      "currentBalance" : "0.0",&lt;BR /&gt;
      "serviceCategories" : [ "INTERNET", "CABLE", "TELEPHONE" ],&lt;BR /&gt;
      "amountBilled" : "577.71",&lt;BR /&gt;
      "minimumDue" : "270.6",&lt;BR /&gt;
      "billDay" : "8",&lt;BR /&gt;
      "statementDueDate" : "20171029",&lt;BR /&gt;
      "totalARBalance" : "577.71",&lt;BR /&gt;
      "ar1To30" : "307.11",&lt;BR /&gt;
      "ar31To60" : "198.89",&lt;BR /&gt;
      "ar61To90" : "71.71",&lt;BR /&gt;
      "ar91To120" : "0.0",&lt;BR /&gt;
      "ar121To150" : "0.0",&lt;BR /&gt;
      "arOver150Days" : "0.0",&lt;BR /&gt;
      "writeOffAmount" : "0.0",&lt;BR /&gt;
      "totalUnappliedPayment" : "0.0",&lt;BR /&gt;
      "totalUnappliedAdjustment" : "0.0",&lt;BR /&gt;
      "depositDue" : "0.0",&lt;BR /&gt;
      "depositPaid" : "0.0",&lt;BR /&gt;
      "depositInterest" : "0.0",&lt;BR /&gt;
      "totalMonthlyRate" : "174.23",&lt;BR /&gt;
      "lastStatementDate" : "20171009"&lt;BR /&gt;
    } ]&lt;BR /&gt;
  }&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:14:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305315#M91650</guid>
      <dc:creator>yograjpatel</dc:creator>
      <dc:date>2020-09-29T16:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the fields from JSON output and display as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305316#M91651</link>
      <description>&lt;P&gt;What do you see in Splunk for this type of data already? If the data was on-boarded correctly, you should already have the fields extracted and you can do the table easily enough. So if you can give us an ides of the data that you are currently seeing, then we can probably help you. If you don't have access to fixing the data problem (you aren't a Splunk admin), then we can help with that, too, but please give us some more information. &lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 18:36:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305316#M91651</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-10-12T18:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the fields from JSON output and display as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305317#M91652</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
We dont see the data extracted and I dont have admin access. So looking to extract data using spath which i'm not successful.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 18:38:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305317#M91652</guid>
      <dc:creator>yograjpatel</dc:creator>
      <dc:date>2017-10-12T18:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the fields from JSON output and display as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305318#M91653</link>
      <description>&lt;P&gt;Yeah, path won't work if it isn't already extracted. &lt;/P&gt;

&lt;P&gt;Do you care about the hierarchy of the data? That makes it a bit more difficult. &lt;/P&gt;

&lt;P&gt;And is this a complete list of the fields?&lt;/P&gt;

&lt;P&gt;And do you need all the fields extracted, or just some of them?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 18:44:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305318#M91653</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-10-12T18:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the fields from JSON output and display as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305319#M91654</link>
      <description>&lt;P&gt;my main output needs the accountNumber13, siteId and totalARBalance.&lt;/P&gt;

&lt;P&gt;Rest i can update later.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 20:00:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305319#M91654</guid>
      <dc:creator>yograjpatel</dc:creator>
      <dc:date>2017-10-12T20:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the fields from JSON output and display as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305320#M91655</link>
      <description>&lt;P&gt;Given the information in the comments above, try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "\"accountNumber13\"\s:\s\"(?P&amp;lt;accountNumber13&amp;gt;\d+)\"[\s\S]*\"siteId\"\s:\s\"(?P&amp;lt;siteId&amp;gt;\d+)\"[\s\S]*\"totalARBalance\"\s:\s\"(?P&amp;lt;totalARBalance&amp;gt;[\d\.]+)\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It can also be a basis for your future modifications. This worked on the data using regex101.com, so it should work in the rex command as I have provided. If you need it to run faster, there is a version that I did that needs the data to be pretty similar to the data you provided, but it only shaves of 20% of the steps, so it probably isn't worth it to make that modification.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 00:13:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305320#M91655</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-10-13T00:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the fields from JSON output and display as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305321#M91656</link>
      <description>&lt;P&gt;In case you get an access to props.conf /transforms.conf, following configurations can help you in  extracting all the fields within your JSON string .&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Props.conf
[yoursource type]
REPORT-json = report-json

Transforms.conf
[report-json]
REGEX = "(\w+)":["}]*([\w\-\:\+\/\.\@]*)
FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Oct 2017 06:03:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305321#M91656</guid>
      <dc:creator>hardikJsheth</dc:creator>
      <dc:date>2017-10-13T06:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the fields from JSON output and display as table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305322#M91657</link>
      <description>&lt;P&gt;Thanks much, this solved my problem&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 13:52:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-fields-from-JSON-output-and-display-as-table/m-p/305322#M91657</guid>
      <dc:creator>yograjpatel</dc:creator>
      <dc:date>2017-10-13T13:52:51Z</dc:date>
    </item>
  </channel>
</rss>

