<?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 from JSON data conforming to XDAS-v2? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166314#M47374</link>
    <description>&lt;P&gt;Hi mschlereth, with these parameters the forwarder won't start anymore complaining about&lt;/P&gt;

&lt;P&gt;06-23-2015 16:37:24.113 +0200 ERROR JsonLineBreaker - JSON StreamID: 13302974020879139619 had parsing error: Unexpected character while looking for value: 'J'&lt;/P&gt;

&lt;P&gt;Also do you mind posting the setting you use to extract the timestamp from &lt;/P&gt;

&lt;P&gt;{"Offset" : 1435057782}&lt;/P&gt;

&lt;P&gt;?&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jun 2015 14:52:20 GMT</pubDate>
    <dc:creator>dominiquevocat</dc:creator>
    <dc:date>2015-06-23T14:52:20Z</dc:date>
    <item>
      <title>How to extract fields from JSON data conforming to XDAS-v2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166310#M47370</link>
      <description>&lt;P&gt;I have some json conforming to XDAS-v2 and, unfortunately, the spath command cannot make much sense of it. Is there a easy way to use this kind of json that I overlooked?&lt;/P&gt;

&lt;P&gt;I tried to do some of it with props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[xdas-events]
KV_MODE = JSON
INDEXED_EXTRACTIONS = JSON
pulldown_type=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Jun 18 12:28:31 IDM : INFO {"Source" : "IDM","Observer" : {"Entity" : {"SysName" : "chhs-sidm017"}},"Initiator" : {"Entity" : {"SvcName" : "CN=INTG2,OU=SYSTEM,O=SOME","SvcComp" : "\\Driver"}},"Target" : {"Data" : {"DATA" : "&amp;lt;status level=\"success\" type=\"driver-status\"&amp;gt;Driver state changed to Running.&amp;lt;application&amp;gt;DirXML&amp;lt;/application&amp;gt;\n\t&amp;lt;module&amp;gt;WORKER&amp;lt;/module&amp;gt;\n\t&amp;lt;object-dn&amp;gt;&amp;lt;/object-dn&amp;gt;\n\t&amp;lt;component&amp;gt;Subscriber&amp;lt;/component&amp;gt;\n&amp;lt;/status&amp;gt;","MIME_HINT" : "3","ORIGINATOR_TYPE" : "1","TARGET_TYPE" : "1","TEXT3" : "Driver state changed to Running.","VALUE1" : "2","VALUE2" : "0","VALUE3" : "0"},"Entity" : {"SvcName" : "CN=WORKER,CN=IDM-INTG,OU=IDM,OU=SYSTEM,O=SOME","SvcComp" : "DirXML-State"}},"Action" : {"Event" : {"Id" : "0.0.3.5","Name" : "Enable Service","SubEvent" : "30022"},"Time" : {"Offset" : 1434623311},"Log" : {"Severity" : 7}}} 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The schema of the content is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
    "id":"XDASv2",
    "title":"XDAS Version 2 JSON Schema",
    "description":"A JSON representation of an XDASv2 event record.",
    "type":"objectr",
    "properties":{
      "Source":{
        "description":"The original source of the event, if applicable.",
        "type":"string",
        "optional":true
      },
      "Observer":{
        "description":"The recorder (ie., the XDASv2 service) of the event.",
        "type":"object",
        "optional":false,
        "properties":{
          "Account":{"$ref":"account"},
          "Entity":{"$ref":"entity"}
        }
      },
      "Initiator":{
        "description":"The authenticated entity or access token that causes an event.",
        "type":"object",
        "optional":false,
        "properties":{
          "Account":{"$ref":"account","optional":true},
          "Entity":{"$ref":"entity"},
          "Assertions":{
            "description":"Attribute/value assertions about an identity.",
            "type":"object",
            "optional":true
          }
        }
      },
      "Target":{
        "description":"The target object, account, data item, etc of the event.",
        "type":"object",
        "optional":true,
        "properties":{
          "Account":{"$ref":"account"},
          "Entity":{"$ref":"entity"},
          "Data":{                           
            "description":"A set attribute/value pairs describing the target object.",        * 
            "type":"object",        
            "optional":true
          }  
        }
      },
      "Action":{
        "description":"The action describes the event in a uniform manner.",
        "type":"object",
        "optional":false,
        "properties":{
          "Event":{
            "description":"The event identifier in standard XDASv2 taxonomy.",
            "type":"object",
            "optional":false,
            "properties":{
              "Id":{
                "description":"The XDASv2 taxonomy event identifier.",
                "type":"string",
                "optional":false,
                "pattern":"/^[0-9]+(\.[0-9]+)*$/" 
              },
              "Name":{
                "description":"A short descriptive name for the specific event.", eg. a new replica is added 
                "type":"string",
                "optional":true
              },
      "CorrelationID":{
          "description":"Correlation ID, source#uniqueID#connID",
                 "type":"string",
                 "optional":true
      }
     },
     "SubEvent":{
      "type":object
      "description": "Describes the actual domain specific event that has occured.",
      "optional":true,
      "properties":{
        "Name"":{
                    "description":"A short descriptive name for this event.",
                    "type":"string",
                    "optional":true
                  },
      }
            }  
          }
          "Log":{
            "description":"Client-specified logging attributes.",
            "optional":true,
            "properties":{
              "Severity":{"type":"integer", "optional":true},
              "Priority":{"type":"integer", "optional":true},
              "Facility":{"type":"integer", "optional":true}
            }
          }
          "Outcome":{
            "description":"The XDASv2 taxonomy outcome identifier.",
            "type":"string",
            "optional":false,
            "pattern":"/^[0-9]+(\.[0-9]+)*$/"
          }
          "Time":{
            "description":"The time the event occurred.",
            "type":"object",
            "optional":false,
            "properties":{
              "Offset":{
                "description":"Seconds since Jan 1, 1970.",
                "type":"integer"
              },
              "Sequence":{
                "description":"Milliseconds since last integral second.",
                "type":"integer",
                "optional":true
              },
              "Tolerance":{
                "description":"A tolerance value in milliseconds.",
                "type":"integer",
                "optional":true
              },
              "Certainty":{
                "description":"Percentage certainty of tolerance.",
                "type":"integer",
                "optional":true,
                "minimum":0,
                "maximum":100,
                "default":100,
              },
              "Source":{
                "description":"The time source (eg., ntp://time.nist.gov).",
                "type":"string",
                "optional":true
              },
              "Zone":{
                "description":"A valid timezone symbol (eg., MST/MDT).",
                "type":"string",
                "optional":true
              }
            }
      "ExtendedOutcome":{
            "description":"The XDASv2 taxonomy outcome identifier.",
            "type":"string",
            "optional":false,
            "pattern":"/^[0-9]+(\.[0-9]+)*$/"
           }
        }
      }
    }
  },
  {
    "id":"account",
    "description":"A representation of an XDAS account.",
    "type":"object",
    "properties":{
      "Domain":{
        "description":"A (URL) reference to the authority managing this account.",    /* lets take it as the partition?
        "type":"string"
      },
      "Name":{
        "description":"A human-readable account name.",        - DN
        "type":"string",
        "optional":true
      },
      "Id":{
        "description":"A machine-readable unique account identifier value.",  - EntryID
        "type":"integer"
      }
    }
  },
  {
    "id":"entity",                    - Server details for Target, client address details for the initiator
    "description":"A representation of an addressable entity.",
    "type":"object",
    "properties":{
      "SysAddr":{"type":"string","optional":true},  
      "SysName":{"type":"string","optional":true},
      "SvcName":{"type":"string","optional":true},
      "SvcComp":{"type":"string","optional":true},
    }
  }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Jun 2015 08:06:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166310#M47370</guid>
      <dc:creator>dominiquevocat</dc:creator>
      <dc:date>2015-06-18T08:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from JSON data conforming to XDAS-v2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166311#M47371</link>
      <description>&lt;P&gt;if i do &lt;BR /&gt;
 | eval tmp=substr(_raw,27) | spath input=tmp | fields - tmp&lt;BR /&gt;
it looks pretty fine so i think if i get the indexing as json correct then it should work out of the box.&lt;/P&gt;

&lt;P&gt;now in props.conf on the indexer i have&lt;/P&gt;

&lt;P&gt;[xdas-events]&lt;BR /&gt;
SEDCMD-StripHeader = ^[^{]+&lt;BR /&gt;
KV_MODE = json&lt;BR /&gt;
INDEXED_EXTRACTIONS = json&lt;BR /&gt;
pulldown_type=1&lt;/P&gt;

&lt;P&gt;but it does not seem to work so well...&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:19:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166311#M47371</guid>
      <dc:creator>dominiquevocat</dc:creator>
      <dc:date>2020-09-28T20:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from JSON data conforming to XDAS-v2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166312#M47372</link>
      <description>&lt;P&gt;To have spath work correctly, Splunk must recognize the output as JSON. With the leading "syslog-style" meta information, the event is now no longer "json" and won't parse correctly. If you have access to the output logger of the app, change it to insert a timestamp into the json, and only output the JSON on a single line with no other information around it. Notice the event below, and the two additional fields I added at the front.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ "log_level":"INFO", "_time": "Jun 18 12:28:31", "Source" : "IDM","Observer" : {"Entity" : {"SysName" : "chhs-sidm017"}},"Initiator" : {"Entity" : {"SvcName" : "CN=INTG2,OU=SYSTEM,O=SOME","SvcComp" : "\\Driver"}},"Target" : {"Data" : {"DATA" : "&amp;lt;status level=\"success\" type=\"driver-status\"&amp;gt;Driver state changed to Running.&amp;lt;application&amp;gt;DirXML&amp;lt;/application&amp;gt;\n\t&amp;lt;module&amp;gt;WORKER&amp;lt;/module&amp;gt;\n\t&amp;lt;object-dn&amp;gt;&amp;lt;/object-dn&amp;gt;\n\t&amp;lt;component&amp;gt;Subscriber&amp;lt;/component&amp;gt;\n&amp;lt;/status&amp;gt;","MIME_HINT" : "3","ORIGINATOR_TYPE" : "1","TARGET_TYPE" : "1","TEXT3" : "Driver state changed to Running.","VALUE1" : "2","VALUE2" : "0","VALUE3" : "0"},"Entity" : {"SvcName" : "CN=WORKER,CN=IDM-INTG,OU=IDM,OU=SYSTEM,O=SOME","SvcComp" : "DirXML-State"}},"Action" : {"Event" : {"Id" : "0.0.3.5","Name" : "Enable Service","SubEvent" : "30022"},"Time" : {"Offset" : 1434623311},"Log" : {"Severity" : 7}}}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jun 2015 12:36:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166312#M47372</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-06-22T12:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from JSON data conforming to XDAS-v2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166313#M47373</link>
      <description>&lt;P&gt;I have been struggling with the same problem and finally got it to work. &lt;/P&gt;

&lt;P&gt;The first thing I did was to modify the default xdasconfig.properties file for the layout.ConversionPattern to not put the syslog level and time stamp and to only output the json event. &lt;/P&gt;

&lt;P&gt;log4j.appender.R.layout.ConversionPattern=%m%n&lt;/P&gt;

&lt;P&gt;I found through searching many posts that INDEXED_EXTRACTIONS do NOT work on indexers. INDEXED_EXTRACTIONS are applied on forwarders. From what I can tell this is something that changed in version 6. Once I put the following in the props.conf file Universal Forwarder which has the xdas log file local it started working like a charm. &lt;/P&gt;

&lt;P&gt;props.conf on Universal Forwarder&lt;BR /&gt;
[xdas]&lt;BR /&gt;
 INDEXED_EXTRACTIONS = json&lt;BR /&gt;
 detect_trailing_nulls = auto&lt;BR /&gt;
 SHOULD_LINEMERGE = false&lt;/P&gt;

&lt;P&gt;Finally, modify the props.conf file on the indexer to not perform search time indexing otherwise the fields will appear to be duplicated. &lt;/P&gt;

&lt;P&gt;props.conf on the indexer&lt;BR /&gt;
[xdas]&lt;BR /&gt;
 KV_MODE = none&lt;BR /&gt;
 AUTO_KV_JSON = false&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:17:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166313#M47373</guid>
      <dc:creator>mschlereth</dc:creator>
      <dc:date>2020-09-28T20:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from JSON data conforming to XDAS-v2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166314#M47374</link>
      <description>&lt;P&gt;Hi mschlereth, with these parameters the forwarder won't start anymore complaining about&lt;/P&gt;

&lt;P&gt;06-23-2015 16:37:24.113 +0200 ERROR JsonLineBreaker - JSON StreamID: 13302974020879139619 had parsing error: Unexpected character while looking for value: 'J'&lt;/P&gt;

&lt;P&gt;Also do you mind posting the setting you use to extract the timestamp from &lt;/P&gt;

&lt;P&gt;{"Offset" : 1435057782}&lt;/P&gt;

&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 14:52:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166314#M47374</guid>
      <dc:creator>dominiquevocat</dc:creator>
      <dc:date>2015-06-23T14:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from JSON data conforming to XDAS-v2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166315#M47375</link>
      <description>&lt;P&gt;hm, this in props.xonf on the forwarder seems to do fairly well:&lt;/P&gt;

&lt;P&gt;TIME_FORMAT=%s&lt;BR /&gt;
TIMESTAMP_FIELDS=Action.Time.Offset&lt;BR /&gt;
INDEXED_EXTRACTIONS=json&lt;BR /&gt;
NO_BINARY_CHECK=true&lt;BR /&gt;
KV_MODE=json&lt;BR /&gt;
disabled=false&lt;BR /&gt;
pulldown_type=true&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:21:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166315#M47375</guid>
      <dc:creator>dominiquevocat</dc:creator>
      <dc:date>2020-09-28T20:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from JSON data conforming to XDAS-v2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166316#M47376</link>
      <description>&lt;P&gt;I have not got around to getting the timestamp working. I was just using the index time as being good enough.  I think TIMESTAMP_FIELDS needs to go in the props.conf on the indexer rather than the forwarder but not sure. &lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 18:34:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166316#M47376</guid>
      <dc:creator>mschlereth</dc:creator>
      <dc:date>2015-06-23T18:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from JSON data conforming to XDAS-v2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166317#M47377</link>
      <description>&lt;P&gt;Sorry to necro post, but  dominiquevocat comment seemed the simplest way to go, and I think was almost there.&lt;/P&gt;

&lt;P&gt;On the forwarder recieving the syslog from our eDirectory servers, i created a new eDir app and added a props.conf with &lt;/P&gt;

&lt;P&gt;Defined in eDir Apps props.conf (sedCMDs to remove the preceeding “eDirectory : INFO ” and” IDM : INFO ”)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[eDirXDAS]
SEDCMD-StripEDirInfo = s/eDirectory : INFO {/{/g
SEDCMD-StripIDMInfo = s/IDM : INFO {/{/g
KV_MODE = json
INDEXED_EXTRACTIONS = json
pulldown_type=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then set the sourcetype for that syslog listener to eDirXDAS.&lt;BR /&gt;
The SED commands can be added to for any other strings that are being prepended to the supplied JSON.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 01:10:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-from-JSON-data-conforming-to-XDAS-v2/m-p/166317#M47377</guid>
      <dc:creator>liamalexandertm</dc:creator>
      <dc:date>2019-05-15T01:10:57Z</dc:date>
    </item>
  </channel>
</rss>

