<?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: Extract all key value pairs JSON in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549605#M155958</link>
    <description>&lt;P&gt;The data actually has indentions on lines 2-13.&amp;nbsp; My original post was incorrectly pasted with data in the first position of each line.&amp;nbsp; The full event is being pulled into Splunk as I would expect, but all the key pairs are not being recognized.&amp;nbsp; I have attempted to paste below what the data actually looks like.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&amp;nbsp; "sessionId": "kevin70",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"service": "RAF",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"request": { "vendorId": "Digital", "clientId: "1234567890d" },&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"response":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; { "vendorId": "Digital",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "clientId": "1234567890d",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "transactionStatus": "7000",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "transactionMessage": "Success" },&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"elapsedTime": "513",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"timestamp_begin": 2021-04-26T21:33:43.893Z,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"level": "info",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"message": "SUCCESS",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"timestamp": "2021-04-26T21:33:44.406Z" }&lt;/P&gt;&lt;P&gt;Thanks for taking a look.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Apr 2021 12:48:22 GMT</pubDate>
    <dc:creator>kwarre3036</dc:creator>
    <dc:date>2021-04-28T12:48:22Z</dc:date>
    <item>
      <title>Extract all key value pairs JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549526#M155924</link>
      <description>&lt;P&gt;I have the following log example and Splunk correctly pulls the first few fields (non-nested) as well as the first value pair of the nested fields.&amp;nbsp; However, after the first field, Splunk does not seem to recognize the remaining fields.&lt;/P&gt;&lt;P&gt;{ "sessionId": "kevin70",&lt;BR /&gt;"service": "RAF",&lt;BR /&gt;"request": { "vendorId": "Digital", "clientId: "1234567890d" },&lt;BR /&gt;"response":&lt;BR /&gt;{ "vendorId": "Digital",&lt;BR /&gt;"clientId": "1234567890d",&lt;BR /&gt;"transactionStatus": "7000",&lt;BR /&gt;"transactionMessage": "Success" },&lt;BR /&gt;"elapsedTime": "513",&lt;BR /&gt;"timestamp_begin": 2021-04-26T21:33:43.893Z,&lt;BR /&gt;"level": "info",&lt;BR /&gt;"message": "SUCCESS",&lt;BR /&gt;"timestamp": "2021-04-26T21:33:44.406Z" }&lt;/P&gt;&lt;P&gt;My props.conf looks like the following:&lt;/P&gt;&lt;P&gt;[json_v3]&lt;BR /&gt;BREAK_ONLY_BEFORE = ^{&lt;BR /&gt;LINE_BREAKER = ^{&lt;BR /&gt;KV_MODE=json&lt;BR /&gt;NO_BINARY_CHECK = true&lt;BR /&gt;TZ = America/Chicago&lt;BR /&gt;category = Structured&lt;BR /&gt;description = A variant of the JSON source type, with support for nonexistent timestamps&lt;BR /&gt;disabled = false&lt;BR /&gt;pulldown_type = true&lt;BR /&gt;BREAK_ONLY_BEFORE_DATE =&lt;/P&gt;&lt;P&gt;My inputs.conf looks like this:&lt;/P&gt;&lt;P&gt;[monitor:///home/myuser/json_test.log]&lt;BR /&gt;index = personalizedoffer&lt;BR /&gt;source = json_test.log&lt;BR /&gt;sourcetype = json_v3&lt;BR /&gt;host = myhost&lt;/P&gt;&lt;P&gt;The last value pair that Splunk recognized is request.vendorId.&amp;nbsp; After that, no other fields are automatically generated.&amp;nbsp; Additionally, I have attempted to use spath by piping it to my simple search which is below:&lt;/P&gt;&lt;P&gt;index=personalizedoffer source="json_test.log"&lt;/P&gt;&lt;P&gt;I want the values of pairs represented including:&lt;/P&gt;&lt;P&gt;request.clientId, response.vendorId, response.clientId, response.transactionStatus, response,transactionMessage, elapsedTime, timestamp_begin, level, message, timestamp&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 20:22:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549526#M155924</guid>
      <dc:creator>kwarre3036</dc:creator>
      <dc:date>2021-04-27T20:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extract all key value pairs JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549546#M155937</link>
      <description>&lt;P&gt;If the raw data is exactly as shown then I believe the problem is caused by &lt;FONT face="courier new,courier"&gt;BREAK_&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;ONLY_BEFORE = ^{&lt;/FONT&gt;.&amp;nbsp; It forces an event break at "{ "vendorId": "Digital",".&amp;nbsp; Try &lt;FONT face="courier new,courier"&gt;MUST_BREAK_AFTER = }$&lt;/FONT&gt; to tell Splunk to break events after the end.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 23:49:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549546#M155937</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-04-27T23:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract all key value pairs JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549605#M155958</link>
      <description>&lt;P&gt;The data actually has indentions on lines 2-13.&amp;nbsp; My original post was incorrectly pasted with data in the first position of each line.&amp;nbsp; The full event is being pulled into Splunk as I would expect, but all the key pairs are not being recognized.&amp;nbsp; I have attempted to paste below what the data actually looks like.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&amp;nbsp; "sessionId": "kevin70",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"service": "RAF",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"request": { "vendorId": "Digital", "clientId: "1234567890d" },&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"response":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; { "vendorId": "Digital",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "clientId": "1234567890d",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "transactionStatus": "7000",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "transactionMessage": "Success" },&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"elapsedTime": "513",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"timestamp_begin": 2021-04-26T21:33:43.893Z,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"level": "info",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"message": "SUCCESS",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"timestamp": "2021-04-26T21:33:44.406Z" }&lt;/P&gt;&lt;P&gt;Thanks for taking a look.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 12:48:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549605#M155958</guid>
      <dc:creator>kwarre3036</dc:creator>
      <dc:date>2021-04-28T12:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extract all key value pairs JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549663#M155983</link>
      <description>&lt;P&gt;It looks like it's not extracting successfully because the&amp;nbsp;&lt;FONT color="#FF0000"&gt;"clientId&lt;/FONT&gt;&amp;nbsp;is missing a closing quote.&lt;/P&gt;&lt;P&gt;Adding in back in and using the following settings extracts the fields successfully:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;BREAK_ONLY_BEFORE = ^{ \"sessionId
MUST_BREAK_AFTER = }$
TIME_PREFIX = timestamp\"\:\ \"
KV_MODE = json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 16:32:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549663#M155983</guid>
      <dc:creator>akheraj_splunk</dc:creator>
      <dc:date>2021-04-28T16:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Extract all key value pairs JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549667#M155985</link>
      <description>&lt;P&gt;the value for timestamp_begin is also not enclosed by quotes. So you won't get the fields: timestamp_begin, message and level. Enclosing the value in quotes fixes it.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 17:21:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549667#M155985</guid>
      <dc:creator>akheraj_splunk</dc:creator>
      <dc:date>2021-04-28T17:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extract all key value pairs JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549668#M155986</link>
      <description>&lt;P&gt;This is working, but I have one follow=up question.&amp;nbsp; There are now two values for timestamp.&amp;nbsp; The first is "none" and the second is "&lt;SPAN&gt;2021-04-26T21:33:44.406Z".&amp;nbsp; It looks like this is a keyword to Splunk.&amp;nbsp; I would like the "_time" field to continue to be the time the data was indexed (current_time), but I would like to create a timestamp field with only one value = "2021-04-26T21:33:44.406Z"?&amp;nbsp; Is there a way to eliminate the value "none"?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 18:10:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549668#M155986</guid>
      <dc:creator>kwarre3036</dc:creator>
      <dc:date>2021-04-28T18:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extract all key value pairs JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549669#M155987</link>
      <description>&lt;P&gt;I think I can do this in the transforms.conf.&amp;nbsp; That is what I will try next.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 18:12:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-all-key-value-pairs-JSON/m-p/549669#M155987</guid>
      <dc:creator>kwarre3036</dc:creator>
      <dc:date>2021-04-28T18:12:29Z</dc:date>
    </item>
  </channel>
</rss>

