<?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: Field Extraction from Complex json files in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610434#M212285</link>
    <description>&lt;P&gt;Yes, you can but I am not sure of the 'correct' way to do it&lt;/P&gt;&lt;P&gt;See&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347952" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347952&lt;/A&gt;&lt;/P&gt;&lt;P&gt;where someone else has a similar issue or maybe these legends can help&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2022 05:03:28 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2022-08-23T05:03:28Z</dc:date>
    <item>
      <title>Help with Field Extraction from Complex json files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610422#M212275</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;is there any way we can extract fields from this sample data, any help will be highly appreciated.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2022-07-22 17:21:50 - { "type" : "core", "r/o" : false, "booting" : true, "version" : "7.2.9.GA", "user" : "anonymous", "domainUUID" : null, "access" : null, "remote-address" : null, "success" : true, "ops" : [ { "operation" : "add", "address" : [{ "system-property" : "dstest.tx.node.id" }], "value" : "vp2mbg_c001_r3050" }, { "operation" : "add", "address" : [{ "system-property" : "jdk.tls.client.protocols" }], "value" : "TLSv1.2" }, { "operation" : "add", "address" : [{ "system-property" : "org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT" }], "value" : "600000" }, { "operation" : "add", "address" : [{ "system-property" : "org.apache.coyote.ajp.MAX_PACKET_SIZE" }], "value" : "65536" }, { "operation" : "add", "address" : [{ "system-property" : "javax.net.ssl.trustStore" }], "value" : "/opt/app/dstest/ssl/cacerts.jks" }, { "operation" : "add", "address" : [{ "system-property" : "javax.net.ssl.trustStorePassword" }], "value" : { "EXPRESSION_VALUE" : "${VAULT::vb::truststorepass::1}" } }, { "operation" : "add", "address" : [{ "system-property" : "javax.net.ssl.keyStore" }], "value" : "/opt/app/DSTest/ssl/tccs-proddr.keystore" }, { "operation" : "add", "address" : [{ "system-property" : "javax.net.ssl.keyStorePassword" }], "value" : { "EXPRESSION_VALUE" : "${VAULT::vb::certpass::1}" } }, { "operation" : "add", "address" : [{ "system-property" : "tcp.allow.dev.esa.token" }], "value" : "true" }, { "operation" : "add", "address" : [{ "system-property" : "tccs.allow.dev.esa.token" }], "value" : "true" }, { "operation" : "add", "address" : [{ "system-property" : "CLAS.ENVIRONMENT" }], "value" : "prod" }, { "operation" : "add", "address" : [{ "system-property" : "TCCS.ENVIRONMENT" }], "value" : "prod" }, { "operation" : "add", "address" : [{ "system-property" : "agent.user" }], "value" : { "EXPRESSION_VALUE" : "${VAULT::vb::agentuser::1}" } }, { "operation" : "add", "address" : [{ "system-property" : "agent.password" }], "value" : { "EXPRESSION_VALUE" : "${VAULT::vb::agentpass::1}" } }, { "address" : [{ "path" : "DSTest.server.ADCredStore.dir" }], "operation" : "add", "path" : "/opt/app/DSTest/profiles/instances/tccs/ADCredStore" }, { "address" : [{ "path" : "DSTest.ssl" }], "operation" : "add", "path" : "/opt/app/DSTest/ssl" }, { "address" : [{ "core-service" : "vault" }], "operation" : "add", "vault-options" : [ { "KEYSTORE_URL" : "/opt/app/DSTest/profiles/instances/tccs/configuration/eap7vault.keystore" }, { "KEYSTORE_PASSWORD" : "MASK-0dF/GimhesRBlxgjOeSNqf" }, { "KEYSTORE_ALIAS" : "vault" }, { "SALT" : "147asa2900" }, { "ITERATION_COUNT" : "8" }, { "ENC_FILE_DIR" : "/opt/app/DSTest/profiles/instances/tccs/configuration/" } ] }] }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 13:42:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610422#M212275</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2022-08-23T13:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Complex json files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610430#M212281</link>
      <description>&lt;P&gt;If the part following the date/time is good JSON, then you can do this - this search uses your data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="2022-07-22 17:21:50 - { \"type\" : \"core\", \"r/o\" : false, \"booting\" : true, \"version\" : \"7.2.9.GA\", \"user\" : \"anonymous\", \"domainUUID\" : null, \"access\" : null, \"remote-address\" : null, \"success\" : true, \"ops\" : [ { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"dstest.tx.node.id\" }], \"value\" : \"vp2mbg_c001_r3050\" }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"jdk.tls.client.protocols\" }], \"value\" : \"TLSv1.2\" }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT\" }], \"value\" : \"600000\" }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"org.apache.coyote.ajp.MAX_PACKET_SIZE\" }], \"value\" : \"65536\" }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"javax.net.ssl.trustStore\" }], \"value\" : \"/opt/app/dstest/ssl/cacerts.jks\" }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"javax.net.ssl.trustStorePassword\" }], \"value\" : { \"EXPRESSION_VALUE\" : \"${VAULT::vb::truststorepass::1}\" } }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"javax.net.ssl.keyStore\" }], \"value\" : \"/opt/app/DSTest/ssl/tccs-proddr.keystore\" }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"javax.net.ssl.keyStorePassword\" }], \"value\" : { \"EXPRESSION_VALUE\" : \"${VAULT::vb::certpass::1}\" } }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"tcp.allow.dev.esa.token\" }], \"value\" : \"true\" }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"tccs.allow.dev.esa.token\" }], \"value\" : \"true\" }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"CLAS.ENVIRONMENT\" }], \"value\" : \"prod\" }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"TCCS.ENVIRONMENT\" }], \"value\" : \"prod\" }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"agent.user\" }], \"value\" : { \"EXPRESSION_VALUE\" : \"${VAULT::vb::agentuser::1}\" } }, { \"operation\" : \"add\", \"address\" : [{ \"system-property\" : \"agent.password\" }], \"value\" : { \"EXPRESSION_VALUE\" : \"${VAULT::vb::agentpass::1}\" } }, { \"address\" : [{ \"path\" : \"DSTest.server.ADCredStore.dir\" }], \"operation\" : \"add\", \"path\" : \"/opt/app/DSTest/profiles/instances/tccs/ADCredStore\" }, { \"address\" : [{ \"path\" : \"DSTest.ssl\" }], \"operation\" : \"add\", \"path\" : \"/opt/app/DSTest/ssl\" }, { \"address\" : [{ \"core-service\" : \"vault\" }], \"operation\" : \"add\", \"vault-options\" : [ { \"KEYSTORE_URL\" : \"/opt/app/DSTest/profiles/instances/tccs/configuration/eap7vault.keystore\" }, { \"KEYSTORE_PASSWORD\" : \"MASK-0dF/GimhesRBlxgjOeSNqf\" }, { \"KEYSTORE_ALIAS\" : \"vault\" }, { \"SALT\" : \"147asa2900\" }, { \"ITERATION_COUNT\" : \"8\" }, { \"ENC_FILE_DIR\" : \"/opt/app/DSTest/profiles/instances/tccs/configuration/\" } ] }] }"
| rex "[^\{]*(?&amp;lt;json&amp;gt;.*)"
| spath input=json&lt;/LI-CODE&gt;&lt;P&gt;It uses rex to make a field called json with the raw JSON in it, then spath to parse the JSON.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 04:50:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610430#M212281</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-23T04:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Complex json files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610432#M212283</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thank you so much for your quick response. Is there any way I can extract fields using props.conf /transforms.conf files?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 04:53:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610432#M212283</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2022-08-23T04:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Complex json files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610434#M212285</link>
      <description>&lt;P&gt;Yes, you can but I am not sure of the 'correct' way to do it&lt;/P&gt;&lt;P&gt;See&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347952" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347952&lt;/A&gt;&lt;/P&gt;&lt;P&gt;where someone else has a similar issue or maybe these legends can help&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 05:03:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610434#M212285</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-23T05:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Complex json files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610437#M212288</link>
      <description>&lt;P&gt;Thank you so much again. But how can I reach out to them?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 05:11:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610437#M212288</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2022-08-23T05:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Complex json files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610450#M212296</link>
      <description>&lt;P&gt;I do not believe that you can combine the two steps into props.conf. &amp;nbsp;You best bet is to ask the developer who wrote the log files to change the format to pure, conformant JSON, e.g.,&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"timestamp" : "2022-07-22 17:21:50", "type" : "core", "r/o" : false, "booting" : true, "version" : "7.2.9.GA", "user" : "anonymous", "domainUUID" : null, "access" : null, "remote-address" : null, "success" : true, "ops" : [ { "operation" : "add", "address" : [{ "system-property" : "dstest.tx.node.id" }], "value" : "vp2mbg_c001_r3050" }, { "operation" : "add", "address" : [{ "system-property" : "jdk.tls.client.protocols" }], "value" : "TLSv1.2" }, { "operation" : "add", "address" : [{ "system-property" : "org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT" }], "value" : "600000" }, { "operation" : "add", "address" : [{ "system-property" : "org.apache.coyote.ajp.MAX_PACKET_SIZE" }], "value" : "65536" }, { "operation" : "add", "address" : [{ "system-property" : "javax.net.ssl.trustStore" }], "value" : "/opt/app/dstest/ssl/cacerts.jks" }, { "operation" : "add", "address" : [{ "system-property" : "javax.net.ssl.trustStorePassword" }], "value" : { "EXPRESSION_VALUE" : "${VAULT::vb::truststorepass::1}" } }, { "operation" : "add", "address" : [{ "system-property" : "javax.net.ssl.keyStore" }], "value" : "/opt/app/DSTest/ssl/tccs-proddr.keystore" }, { "operation" : "add", "address" : [{ "system-property" : "javax.net.ssl.keyStorePassword" }], "value" : { "EXPRESSION_VALUE" : "${VAULT::vb::certpass::1}" } }, { "operation" : "add", "address" : [{ "system-property" : "tcp.allow.dev.esa.token" }], "value" : "true" }, { "operation" : "add", "address" : [{ "system-property" : "tccs.allow.dev.esa.token" }], "value" : "true" }, { "operation" : "add", "address" : [{ "system-property" : "CLAS.ENVIRONMENT" }], "value" : "prod" }, { "operation" : "add", "address" : [{ "system-property" : "TCCS.ENVIRONMENT" }], "value" : "prod" }, { "operation" : "add", "address" : [{ "system-property" : "agent.user" }], "value" : { "EXPRESSION_VALUE" : "${VAULT::vb::agentuser::1}" } }, { "operation" : "add", "address" : [{ "system-property" : "agent.password" }], "value" : { "EXPRESSION_VALUE" : "${VAULT::vb::agentpass::1}" } }, { "address" : [{ "path" : "DSTest.server.ADCredStore.dir" }], "operation" : "add", "path" : "/opt/app/DSTest/profiles/instances/tccs/ADCredStore" }, { "address" : [{ "path" : "DSTest.ssl" }], "operation" : "add", "path" : "/opt/app/DSTest/ssl" }, { "address" : [{ "core-service" : "vault" }], "operation" : "add", "vault-options" : [ { "KEYSTORE_URL" : "/opt/app/DSTest/profiles/instances/tccs/configuration/eap7vault.keystore" }, { "KEYSTORE_PASSWORD" : "MASK-0dF/GimhesRBlxgjOeSNqf" }, { "KEYSTORE_ALIAS" : "vault" }, { "SALT" : "147asa2900" }, { "ITERATION_COUNT" : "8" }, { "ENC_FILE_DIR" : "/opt/app/DSTest/profiles/instances/tccs/configuration/" } ] }] }
​&lt;/LI-CODE&gt;&lt;P&gt;If they can do this, Splunk will automatically extract fields if you tell it to use JSON data type (INDEXED_EXTRACTIONS = json), or you can ask it not to use JSON type, but to extract JSON data at search time (KV_MODE=json)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 06:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610450#M212296</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-23T06:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Complex json files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610457#M212301</link>
      <description>&lt;P&gt;At the moment, at least that's what I found during my research (I needed that as well), you can't tell Splunk to use only part of the message for structured extractions. It's a shame, really, because it's often that the events do contain some part of non-structured (or "human-structured") header and then a json or xml part at the end.&lt;/P&gt;&lt;P&gt;Unfortunately, the only thing you can do to automatically extract the json/xml/whatever part is use transform to cut the non-structured part from the event. Unfortunately, doing so you're obviously losing data from the cut part. So there's no good solution for that (short of extracting that data first into indexed fields but that's another story and very "non-splunky" way)&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 07:34:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Field-Extraction-from-Complex-json-files/m-p/610457#M212301</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-08-23T07:34:17Z</dc:date>
    </item>
  </channel>
</rss>

