<?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: Make extractions in props.conf  from search query in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469439#M80770</link>
    <description>&lt;P&gt;&lt;A href="https://regex101.com/r/CFIsPf/1"&gt;regex101&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ 
    "rsyslogd-pstats":[ 
        { 
            "name":"action 0",
            "origin":"core.action",
            "processed":50996,
            "failed":0,
            "suspended":0,
            "suspended.duration":0,
            "resumed":0
        },
        { 
            "name":"action 1",
            "origin":"core.action",
            "processed":50996,
            "failed":0,
            "suspended":0,
            "suspended.duration":0,
            "resumed":0
        },
        { 
            "name":"global",
            "origin":"dynstats",
            "values":{ 

            }
        },
        { 
            "name":"imuxsock",
            "origin":"imuxsock",
            "submitted":0,
            "ratelimit.discarded":0,
            "ratelimit.numratelimiters":0
        }
    ]
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SOURCEKEY = foo
REGEX = \"(\S+)\":\"?([\w.]+)\"?
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seems that extraction is possible somehow.&lt;/P&gt;</description>
    <pubDate>Sat, 22 Feb 2020 03:47:13 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-02-22T03:47:13Z</dc:date>
    <item>
      <title>Make extractions in props.conf  from search query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469435#M80766</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="Nov 14 03:23:42 hostname rsyslogd-pstats:{ \"name\": \"global\", \"origin\": \"dynstats\", \"values\": { } }
 Nov 14 03:23:42 hostname rsyslogd-pstats:{ \"name\": \"imuxsock\", \"origin\": \"imuxsock\", \"submitted\": 0, \"ratelimit.discarded\": 0, \"ratelimit.numratelimiters\": 0 }
 Nov 14 03:23:42 hostname rsyslogd-pstats:{ \"name\": \"action 0\", \"origin\": \"core.action\", \"processed\": 50996, \"failed\": 0, \"suspended\": 0, \"suspended.duration\": 0, \"resumed\": 0 }
 Nov 14 03:23:42 hostname rsyslogd-pstats:{ \"name\": \"action 1\", \"origin\": \"core.action\", \"processed\": 50996, \"failed\": 0, \"suspended\": 0, \"suspended.duration\": 0, \"resumed\": 0 }" 
| makemv delim="
 " _raw 
| stats count by _raw 
| rex "(?&amp;lt;json&amp;gt;{.*)" 
| spath input=json
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This query works fine.&lt;BR /&gt;
If I want to extract by &lt;EM&gt;props.conf&lt;/EM&gt;, what's setting?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT = %B %d %T
KV_MODE = json
LINE_BREAKER = ([\r\n]+)
NO_BINARY_CHECK = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I created it above, but I don't know the other settings.&lt;BR /&gt;
If possible, please do not use SEDCMD and use it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FIELD_HEADER_REGEX = ^.*?(?={)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this it?&lt;BR /&gt;
cf. &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/Data/Extractfieldsfromfileswithstructureddata"&gt;Extract fields from files with structured data&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Feb 2020 01:26:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469435#M80766</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-09T01:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Make extractions in props.conf  from search query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469436#M80767</link>
      <description>&lt;P&gt;it think the challenge with INDEXED_EXTRACTIONS there is that you have the timestamp first, so the file / event is not JSON per-se&lt;BR /&gt;
you can use indexed extractions with transfoms.conf &lt;/P&gt;</description>
      <pubDate>Sun, 09 Feb 2020 03:40:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469436#M80767</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2020-02-09T03:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Make extractions in props.conf  from search query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469437#M80768</link>
      <description>&lt;P&gt;Hi, @adonio ,Thank you for your reply .&lt;/P&gt;

&lt;P&gt;I checked, &lt;CODE&gt;FIELD_HEADER_REGEX&lt;/CODE&gt; looks different.&lt;/P&gt;

&lt;P&gt;Which method is appropriate in this case?&lt;/P&gt;</description>
      <pubDate>Sun, 09 Feb 2020 10:09:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469437#M80768</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-09T10:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Make extractions in props.conf  from search query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469438#M80769</link>
      <description>&lt;P&gt;&lt;EM&gt;props.conf&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REPORT-json = json, json_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;EM&gt;transforms.conf&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[json]
CLEAN_KEYS = 0
REGEX = (?P&amp;lt;jsontext&amp;gt;{.*)

[json_field]
CLEAN_KEYS = 0
REGEX = \"(\S+)\": \"?(\w+)\"?
FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;\w+&lt;/CODE&gt; of &lt;CODE&gt;json_field&lt;/CODE&gt; needs to be changed depending on the situation.&lt;BR /&gt;
This JSON is easy because it is not nested.&lt;/P&gt;

&lt;P&gt;What if these are nested?&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2020 03:03:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469438#M80769</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-15T03:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Make extractions in props.conf  from search query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469439#M80770</link>
      <description>&lt;P&gt;&lt;A href="https://regex101.com/r/CFIsPf/1"&gt;regex101&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ 
    "rsyslogd-pstats":[ 
        { 
            "name":"action 0",
            "origin":"core.action",
            "processed":50996,
            "failed":0,
            "suspended":0,
            "suspended.duration":0,
            "resumed":0
        },
        { 
            "name":"action 1",
            "origin":"core.action",
            "processed":50996,
            "failed":0,
            "suspended":0,
            "suspended.duration":0,
            "resumed":0
        },
        { 
            "name":"global",
            "origin":"dynstats",
            "values":{ 

            }
        },
        { 
            "name":"imuxsock",
            "origin":"imuxsock",
            "submitted":0,
            "ratelimit.discarded":0,
            "ratelimit.numratelimiters":0
        }
    ]
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SOURCEKEY = foo
REGEX = \"(\S+)\":\"?([\w.]+)\"?
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seems that extraction is possible somehow.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 03:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469439#M80770</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-22T03:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Make extractions in props.conf  from search query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469440#M80771</link>
      <description>&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[json_sed]
TIME_FORMAT = %B %d %T
SEDCMD = s/.*?({.*)/\1/g
KV_MODE = json
LINE_BREAKER = ([\r\n]+)
NO_BINARY_CHECK = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This setting is OK.&lt;BR /&gt;
I was worried that time information would be lost by using &lt;CODE&gt;SEDCMD&lt;/CODE&gt; ,but there was no problem.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;KV_MODE&lt;/CODE&gt; and &lt;CODE&gt;INDEXED_EXTRACTIONS&lt;/CODE&gt; needs &lt;STRONG&gt;valid&lt;/STRONG&gt; format.&lt;BR /&gt;
If we have invalid json , we should make them to valid format.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2020 03:41:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Make-extractions-in-props-conf-from-search-query/m-p/469440#M80771</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-01T03:41:19Z</dc:date>
    </item>
  </channel>
</rss>

