<?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 use spath command in props.conf or transforms.conf? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347956#M103029</link>
    <description>&lt;P&gt;Go to &lt;CODE&gt;Settings&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;Fields&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;Field extractoins&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;New&lt;/CODE&gt;.&lt;BR /&gt;
Enter anything that you like for &lt;CODE&gt;Name&lt;/CODE&gt; (I suggest something like &lt;CODE&gt;ColonCommaKVPs&lt;/CODE&gt;), Enter the exact name of your &lt;CODE&gt;sourcetype&lt;/CODE&gt; in the &lt;CODE&gt;named&lt;/CODE&gt; field, keep the default of &lt;CODE&gt;Inline&lt;/CODE&gt; for &lt;CODE&gt;Type&lt;/CODE&gt; and &lt;CODE&gt;Sourcetype&lt;/CODE&gt; for &lt;CODE&gt;Apply to&lt;/CODE&gt;, then enter this for &lt;CODE&gt;Extraction/Transform&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"(?&amp;lt;_KEY_1&amp;gt;[^"]*)":"(?&amp;lt;_VAL_1&amp;gt;[^"]*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 22 Apr 2018 21:16:57 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2018-04-22T21:16:57Z</dc:date>
    <item>
      <title>How to use spath command in props.conf or transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347952#M103025</link>
      <description>&lt;P&gt;hello&lt;BR /&gt;
I have a question&lt;/P&gt;

&lt;P&gt;I have a data that access_log data and json data is mixed and my need is to extract field from mixed data.&lt;BR /&gt;
splunk auto extraction field from that key=value format data&lt;BR /&gt;
So, i received extracted json field(field name is "json") like this : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"key":"value", "key":"value", "key":"value", "key":"value", "key":"value" ....(skip)} 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And if I search the json field, I return the data but, I want extracted field from JSON like this : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fields key, key2, key3, key4 ....(skip)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Finally, I found spath command and I got the results that I wanted.&lt;BR /&gt;
I tried to modify props.conf to automatically extract the field from json but it is not working.&lt;/P&gt;

&lt;P&gt;What should I do?&lt;/P&gt;

&lt;P&gt;ps: I tried t0 use the eval command like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval example = spath(json, 'json.key')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval example = json.key 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But that is also not working.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 08:57:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347952#M103025</guid>
      <dc:creator>leeyounsoo</dc:creator>
      <dc:date>2018-04-18T08:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath command in props.conf or transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347953#M103026</link>
      <description>&lt;P&gt;Please specify &lt;/P&gt;

&lt;P&gt;INDEXED_EXTRACTIONS = JSON OR KV_MODE = json but not both . &lt;/P&gt;

&lt;P&gt;The above should extract fields at index time for structured json data .&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:03:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347953#M103026</guid>
      <dc:creator>ssadanala1</dc:creator>
      <dc:date>2020-09-29T19:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath command in props.conf or transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347954#M103027</link>
      <description>&lt;P&gt;Refer to documentation for KV_MODE : &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Automatickey-valuefieldextractionsatsearch-time" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Automatickey-valuefieldextractionsatsearch-time&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and INDEXED_EXTRACTIONS: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Extractfieldsfromfileswithstructureddata#Props.conf_attributes_for_structured_data" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Extractfieldsfromfileswithstructureddata#Props.conf_attributes_for_structured_data&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:03:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347954#M103027</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T19:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath command in props.conf or transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347955#M103028</link>
      <description>&lt;P&gt;Sorry.&lt;/P&gt;

&lt;P&gt;I think you gave me a slightly different answer because I did not give you the exact details.&lt;/P&gt;

&lt;P&gt;The access_log and json data are mixed as follows:&lt;BR /&gt;
"POST /sample.logs HTTP / 1.1" 200 0 "app: /data.swf ..." "another logs ...." 10.10.10.10 - - [November / 2018: 16: 31: "userAgent data. ... "" json = {"key": "value", "key": "value"&lt;/P&gt;

&lt;P&gt;The json field is extracted by the automatic extraction setting of the splunk.&lt;BR /&gt;
What I want is the value of the json field.&lt;/P&gt;

&lt;P&gt;The search command was able to extract the fields with spath command like this :&lt;BR /&gt;
.... | spath input = json.&lt;/P&gt;

&lt;P&gt;How can I get the same results in props.conf or transforms.conf?&lt;/P&gt;

&lt;P&gt;thank you for answer&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 07:34:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347955#M103028</guid>
      <dc:creator>leeyounsoo</dc:creator>
      <dc:date>2018-04-20T07:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath command in props.conf or transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347956#M103029</link>
      <description>&lt;P&gt;Go to &lt;CODE&gt;Settings&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;Fields&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;Field extractoins&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;New&lt;/CODE&gt;.&lt;BR /&gt;
Enter anything that you like for &lt;CODE&gt;Name&lt;/CODE&gt; (I suggest something like &lt;CODE&gt;ColonCommaKVPs&lt;/CODE&gt;), Enter the exact name of your &lt;CODE&gt;sourcetype&lt;/CODE&gt; in the &lt;CODE&gt;named&lt;/CODE&gt; field, keep the default of &lt;CODE&gt;Inline&lt;/CODE&gt; for &lt;CODE&gt;Type&lt;/CODE&gt; and &lt;CODE&gt;Sourcetype&lt;/CODE&gt; for &lt;CODE&gt;Apply to&lt;/CODE&gt;, then enter this for &lt;CODE&gt;Extraction/Transform&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"(?&amp;lt;_KEY_1&amp;gt;[^"]*)":"(?&amp;lt;_VAL_1&amp;gt;[^"]*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Apr 2018 21:16:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347956#M103029</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-04-22T21:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath command in props.conf or transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347957#M103030</link>
      <description>&lt;P&gt;thank you for answer.&lt;BR /&gt;
but, that solution is not working.&lt;BR /&gt;
I think there are two reasons.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;my data is some problem like this :
1-1) some data has zero string &lt;/LI&gt;
&lt;LI&gt;"json= {"key1":"value1", "key2":"","key3":"value3" .....}"&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;1-2) some data format is not "key":"value"&lt;BR /&gt;
- value has blank before "value"&lt;BR /&gt;
- "json= {"key1": "value1", "key2": "","key3": "value3" .....}"&lt;BR /&gt;
- "key":(this place is blank)"value"&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;props.conf overlap&lt;/LI&gt;
&lt;LI&gt;i write props.conf in $SPLUNK_HOME$/etc/system/local/props.conf&lt;/LI&gt;
&lt;LI&gt;your solution place in $SPLUNK_HOME$/etc/apps/$my_app$/local/props.conf&lt;/LI&gt;
&lt;LI&gt;I know that the .conf file under the system folder has a higher priority.
So I moved EXTRACT-my = "(? &amp;lt;_ KEY_1&amp;gt; [^"] + ")" (?  [^ "] +") to props.conf under the system folder.
But it did not work.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;What's wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:11:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347957#M103030</guid>
      <dc:creator>leeyounsoo</dc:creator>
      <dc:date>2020-09-29T19:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath command in props.conf or transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347958#M103031</link>
      <description>&lt;P&gt;You should do it exactly as i described (from the GUI) and make it work, then repackage it in whatever app.  My solution, with a minor adjustment of changing the &lt;CODE&gt;+&lt;/CODE&gt; characters to &lt;CODE&gt;*&lt;/CODE&gt; will work for null values.  I have modified my answer so it now reads like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"(?&amp;lt;_KEY_1&amp;gt;[^"]*)":"(?&amp;lt;_VAL_1&amp;gt;[^"]*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Apr 2018 19:36:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347958#M103031</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-04-23T19:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath command in props.conf or transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347959#M103032</link>
      <description>&lt;P&gt;OK i will tried that. &lt;/P&gt;

&lt;P&gt;thank you for answer!!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 00:00:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347959#M103032</guid>
      <dc:creator>leeyounsoo</dc:creator>
      <dc:date>2018-04-24T00:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath command in props.conf or transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347960#M103033</link>
      <description>&lt;P&gt;hello woodcock.&lt;BR /&gt;
i tried that and that look like work, but that is static.(my think...&lt;BR /&gt;
Perhaps, You gave me the answer that I wanted. but &lt;BR /&gt;
Maybe it is that i did not understand)&lt;/P&gt;

&lt;P&gt;so, In my opinion, your answer is need loop like this : &lt;BR /&gt;
[report-stanza]&lt;BR /&gt;
"(?&amp;lt;_KEY_1&amp;gt;[^"]&lt;EM&gt;)":"(?&amp;lt;_VAL_1&amp;gt;[^"]&lt;/EM&gt;)"&lt;BR /&gt;
"(?&amp;lt;_KEY_2&amp;gt;[^"]&lt;EM&gt;)":"(?&amp;lt;_VAL_2&amp;gt;[^"]&lt;/EM&gt;)"&lt;BR /&gt;
"(?&amp;lt;_KEY_3&amp;gt;[^"]&lt;EM&gt;)":"(?&amp;lt;_VAL_3&amp;gt;[^"]&lt;/EM&gt;)"&lt;/P&gt;

&lt;P&gt;i want dynamic field extraction like this : &lt;BR /&gt;
1. key1, key2, key3 .... is field name (because that key is changed dynamically)&lt;BR /&gt;
2. value1, value2, value3 .... is field value &lt;/P&gt;

&lt;P&gt;finally i want field extraction to simple. &lt;BR /&gt;
use a one regular expression or delims or another way.&lt;BR /&gt;
because that production is Maintenance by customer. so i must make easy to Maintenance.&lt;/P&gt;

&lt;P&gt;I think there is a way like that use spath command in SPL&lt;BR /&gt;
or another way.&lt;/P&gt;

&lt;P&gt;thank you for answer&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:12:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347960#M103033</guid>
      <dc:creator>leeyounsoo</dc:creator>
      <dc:date>2020-09-29T19:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath command in props.conf or transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347961#M103034</link>
      <description>&lt;P&gt;i solve that like this : &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;P&gt;[my_stanza]&lt;BR /&gt;
REGEX = "([^"]+)":(.&lt;EM&gt;?)"(.&lt;/EM&gt;?)"&lt;BR /&gt;
FORMAT = $1::$3&lt;BR /&gt;
MV_ADD = True&lt;/P&gt;

&lt;P&gt;thank you for answer. &lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:12:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/347961#M103034</guid>
      <dc:creator>leeyounsoo</dc:creator>
      <dc:date>2020-09-29T19:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath command in props.conf or transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/617914#M214752</link>
      <description>&lt;P&gt;"(?&amp;lt;_KEY_1&amp;gt;[^"]*)":"(?&amp;lt;_VAL_1&amp;gt;[^"]*)"&lt;BR /&gt;how to get this to work where VAL value is not enclosed by quotes, such as this example :&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;networkConnect": {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"localIp": "10.132.137.105",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"localPort": 64248,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"networkProtocol": "kIPv4",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"remoteIp": "63.247.145.75",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"remotePort": 88&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 20:36:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-spath-command-in-props-conf-or-transforms-conf/m-p/617914#M214752</guid>
      <dc:creator>franktaylor</dc:creator>
      <dc:date>2022-10-20T20:36:38Z</dc:date>
    </item>
  </channel>
</rss>

