<?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 prevent curly brackets from showing up in JSON field names? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120461#M25032</link>
    <description>&lt;P&gt;I just told you how to handle referring to the variable; did you try it?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = json_test | eval products=$vulnerable_products{}.product$ | eval new_field=products. "," .date_zone
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 13 Jul 2015 19:22:20 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-07-13T19:22:20Z</dc:date>
    <item>
      <title>How to prevent curly brackets from showing up in JSON field names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120458#M25029</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;

&lt;P&gt;I'm trying to ingest some JSON data into Splunk, which it handles wonderfully, but I am getting curly brackets in my field names, and this is screwing up some searches. I'm not sure why it is placing these in the field names, as my syntax seems correct:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
    "vulnerable_products": [
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "8.0.0"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "8.0.1"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "8.0.2"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "7.0.6"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "7.0.5"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "6.2.2"
        },
        {
            "product": "apple_tv",
            "part": "a",
            "vendor": "apple",
            "version": "7.0.2"
        },
        {
            "product": "iphone_os",
            "part": "o",
            "vendor": "apple",
            "version": "8.1.2"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "7.0.2"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "7.1.1"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "7.0.1"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "7.1.0"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "7.0.4"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "7.0.3"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "7.1.2"
        },
        {
            "product": "safari",
            "part": "a",
            "vendor": "apple",
            "version": "7.0"
        }
    ],
    "modified": "2015-07-05T21:59:19.410-04:00",
    "summary": "WebKit, as used in Apple iOS before 8.1.3; Apple Safari before 6.2.3, 7.x before 7.1.3, and 8.x before 8.0.3; and Apple TV before 7.0.3, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted web site, a different vulnerability than CVE-2014-4476 and CVE-2014-4479.",
    "published": "2015-01-30T06:59:11.047-05:00",
    "id": "CVE-2014-4477",
    "cvss": {
        "generated-on-datetime": "2015-01-31T17:28:55.997-05:00",
        "availability-impact": "PARTIAL",
        "integrity-impact": "PARTIAL",
        "access-complexity": "MEDIUM",
        "source": "http://nvd.nist.gov",
        "authentication": "NONE",
        "score": 6.8,
        "access-vector": "NETWORK",
        "confidentiality-impact": "PARTIAL"
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is with the arrays contained in &lt;CODE&gt;vulnerable_products&lt;/CODE&gt; turns into:&lt;BR /&gt;
&lt;CODE&gt;vulnerable_products{}.product&lt;/CODE&gt; , and having the curly brackets breaks eval commands, even with ' ' placed around the field name. I'd like to just remove them, but can't figure out how my syntax is wrong...&lt;/P&gt;

&lt;P&gt;Is there anything I need to do with this data to eliminate the {} from the field name?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 18:18:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120458#M25029</guid>
      <dc:creator>jravida</dc:creator>
      <dc:date>2015-07-13T18:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent curly brackets from showing up in JSON field names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120459#M25030</link>
      <description>&lt;P&gt;You can refer to the field name literally using &lt;CODE&gt;$&lt;/CODE&gt; as &lt;CODE&gt;$vulnerable_products{}.product$&lt;/CODE&gt;.  Also you can rename it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rename *{}* AS **
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Jul 2015 19:04:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120459#M25030</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-13T19:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent curly brackets from showing up in JSON field names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120460#M25031</link>
      <description>&lt;P&gt;I did try rename, but say if I pass it to a second eval, it shows no result. If I do the same thing with fields that have no {} it will work every time, as soon as I replace the test field with the {} one:&lt;/P&gt;

&lt;P&gt;index = json_test | eval products='vulnerable_products{}.product'  | eval new_field=products. "," .date_zone&lt;/P&gt;

&lt;P&gt;is broken&lt;/P&gt;

&lt;P&gt;index = json_test | eval products='date_year'  | eval new_field=products. "," .date_zone&lt;/P&gt;

&lt;P&gt;works fine.&lt;/P&gt;

&lt;P&gt;So when the curly brackets are in a field name, it breaks evals downstream. Must be a bug. I want to reformat the data in whichever way, I don't need to use the test data syntax necessarily.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120460#M25031</guid>
      <dc:creator>jravida</dc:creator>
      <dc:date>2020-09-29T06:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent curly brackets from showing up in JSON field names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120461#M25032</link>
      <description>&lt;P&gt;I just told you how to handle referring to the variable; did you try it?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = json_test | eval products=$vulnerable_products{}.product$ | eval new_field=products. "," .date_zone
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Jul 2015 19:22:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120461#M25032</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-13T19:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent curly brackets from showing up in JSON field names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120462#M25033</link>
      <description>&lt;P&gt;Yes that worked, I missed over the $. I was using single quotes. Awesome!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 19:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120462#M25033</guid>
      <dc:creator>jravida</dc:creator>
      <dc:date>2015-07-13T19:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent curly brackets from showing up in JSON field names?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120463#M25034</link>
      <description>&lt;P&gt;The dollar sign ($) trick is just what I needed.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 13:50:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-curly-brackets-from-showing-up-in-JSON-field/m-p/120463#M25034</guid>
      <dc:creator>rbreton</dc:creator>
      <dc:date>2017-08-11T13:50:51Z</dc:date>
    </item>
  </channel>
</rss>

