<?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 Why is my props and transforms configuration not filtering out events from json data as expected? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-props-and-transforms-configuration-not-filtering-out/m-p/131878#M27124</link>
    <description>&lt;P&gt;I have some log files where some entries contain json content, and some entries do not.  I want to extract the json content from between the { } characters and drop everything else&lt;/P&gt;

&lt;P&gt;Sample log data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2015 Jan 27 18:10:35:530 GMT +8 PCM_ARPI-PCM_BE_ARPI_AGENTA1 Info [/Channels/ARPI/Inbound/ChargeSet.Thread.9] - [user] [PCM_ARPI_A11] ChartSet UPD --&amp;gt;1447307
2015 Jan 27 18:10:35:543 GMT +8 PCM_ARPI-PCM_BE_ARPI_AGENTA1 Info [/Channels/ARPI/Inbound/ChargeSet.Thread.9] - [user] [PCM_ARPI_A11] PI--&amp;gt;PEN New N1:1447307|BL_CHRGSET_SETTLED|7fb9467d-2965-4da8-89de-77564ed5aecd|Pending
2015 Jan 27 18:10:35:543 GMT +8 PCM_ARPI-PCM_BE_ARPI_AGENTA1 Info [/Channels/ARPI/Inbound/ChargeSet.Thread.9] - [user] [PCM_ARPI_A11] {"component":"PCM","dateTime":"2015-01-27 18:10:35.543","bKeys":["inv_1447307"],"startMs":1422353435530,"ms":1422353435543,"host":"hklp321p","fail":false,"dest":"IR4.PCM.CHRGSET.UPDATE","domain":"PCM","incomingDomain":"ARPI","destType":"Q","platform":"BE","xcid":"6cf21017-c228-4f17-a289-fb3aed0d5f0c"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first 2 lines should be discarded (never indexed) and the 3rd line should have the json content extracted and indexed using the regular json parsing.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[json_mixed] 
NO_BINARY_CHECK = true
category = Custom 
disabled = false
pulldown_type = true 
TRANSFORMS-set = extractjson,setnull
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extractjson]
REGEX=(.*)(\{.*\}$)
FORMAT= $2
DEST_KEY=_raw

[setnull]
REGEX=[^}]+
DEST_KEY=queue
FORMAT=nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I was able to extract the json portion and index it, but when I attempt to drop the rest of the entries, &lt;STRONG&gt;everything&lt;/STRONG&gt; is dropped. &lt;/P&gt;

&lt;P&gt;To test, I edit the above 2 files, restart splunk, use the 'upload data' feature and select 'json_mixed' as the source type.&lt;BR /&gt;
With  &lt;CODE&gt;TRANSFORMS-set = extractjson&lt;/CODE&gt;  the log entries with json content show up as expected, but the non-json entries are still present in the preview pane.&lt;BR /&gt;&lt;BR /&gt;
With &lt;CODE&gt;TRANSFORMS-set = extractjson,setnull&lt;/CODE&gt; the preview pane is empty.&lt;BR /&gt;&lt;BR /&gt;
With &lt;CODE&gt;TRANSFORMS-set = setnull, extractjson&lt;/CODE&gt; the preview pane gives an error saying no events were found.&lt;/P&gt;

&lt;P&gt;I have tried many different examples on discarding events, and discarding events that do not contain a character, but nothing works right.&lt;/P&gt;

&lt;P&gt;What am I missing here?&lt;/P&gt;</description>
    <pubDate>Thu, 05 Feb 2015 21:28:09 GMT</pubDate>
    <dc:creator>kittle</dc:creator>
    <dc:date>2015-02-05T21:28:09Z</dc:date>
    <item>
      <title>Why is my props and transforms configuration not filtering out events from json data as expected?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-props-and-transforms-configuration-not-filtering-out/m-p/131878#M27124</link>
      <description>&lt;P&gt;I have some log files where some entries contain json content, and some entries do not.  I want to extract the json content from between the { } characters and drop everything else&lt;/P&gt;

&lt;P&gt;Sample log data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2015 Jan 27 18:10:35:530 GMT +8 PCM_ARPI-PCM_BE_ARPI_AGENTA1 Info [/Channels/ARPI/Inbound/ChargeSet.Thread.9] - [user] [PCM_ARPI_A11] ChartSet UPD --&amp;gt;1447307
2015 Jan 27 18:10:35:543 GMT +8 PCM_ARPI-PCM_BE_ARPI_AGENTA1 Info [/Channels/ARPI/Inbound/ChargeSet.Thread.9] - [user] [PCM_ARPI_A11] PI--&amp;gt;PEN New N1:1447307|BL_CHRGSET_SETTLED|7fb9467d-2965-4da8-89de-77564ed5aecd|Pending
2015 Jan 27 18:10:35:543 GMT +8 PCM_ARPI-PCM_BE_ARPI_AGENTA1 Info [/Channels/ARPI/Inbound/ChargeSet.Thread.9] - [user] [PCM_ARPI_A11] {"component":"PCM","dateTime":"2015-01-27 18:10:35.543","bKeys":["inv_1447307"],"startMs":1422353435530,"ms":1422353435543,"host":"hklp321p","fail":false,"dest":"IR4.PCM.CHRGSET.UPDATE","domain":"PCM","incomingDomain":"ARPI","destType":"Q","platform":"BE","xcid":"6cf21017-c228-4f17-a289-fb3aed0d5f0c"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first 2 lines should be discarded (never indexed) and the 3rd line should have the json content extracted and indexed using the regular json parsing.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[json_mixed] 
NO_BINARY_CHECK = true
category = Custom 
disabled = false
pulldown_type = true 
TRANSFORMS-set = extractjson,setnull
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extractjson]
REGEX=(.*)(\{.*\}$)
FORMAT= $2
DEST_KEY=_raw

[setnull]
REGEX=[^}]+
DEST_KEY=queue
FORMAT=nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I was able to extract the json portion and index it, but when I attempt to drop the rest of the entries, &lt;STRONG&gt;everything&lt;/STRONG&gt; is dropped. &lt;/P&gt;

&lt;P&gt;To test, I edit the above 2 files, restart splunk, use the 'upload data' feature and select 'json_mixed' as the source type.&lt;BR /&gt;
With  &lt;CODE&gt;TRANSFORMS-set = extractjson&lt;/CODE&gt;  the log entries with json content show up as expected, but the non-json entries are still present in the preview pane.&lt;BR /&gt;&lt;BR /&gt;
With &lt;CODE&gt;TRANSFORMS-set = extractjson,setnull&lt;/CODE&gt; the preview pane is empty.&lt;BR /&gt;&lt;BR /&gt;
With &lt;CODE&gt;TRANSFORMS-set = setnull, extractjson&lt;/CODE&gt; the preview pane gives an error saying no events were found.&lt;/P&gt;

&lt;P&gt;I have tried many different examples on discarding events, and discarding events that do not contain a character, but nothing works right.&lt;/P&gt;

&lt;P&gt;What am I missing here?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2015 21:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-props-and-transforms-configuration-not-filtering-out/m-p/131878#M27124</guid>
      <dc:creator>kittle</dc:creator>
      <dc:date>2015-02-05T21:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my props and transforms configuration not filtering out events from json data as expected?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-props-and-transforms-configuration-not-filtering-out/m-p/131879#M27125</link>
      <description>&lt;P&gt;Could you change the order as below:&lt;/P&gt;

&lt;P&gt;TRANSFORMS-set = setnull, extractjson&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/Forwarding/Routeandfilterdatad"&gt;From Document&lt;/A&gt;&lt;BR /&gt;
 the order of the transforms in props.conf matters. The null queue transform must come first; if it comes later, it will invalidate the previous transform and route all events to the null queue.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2015 21:31:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-props-and-transforms-configuration-not-filtering-out/m-p/131879#M27125</guid>
      <dc:creator>sanjay_shrestha</dc:creator>
      <dc:date>2015-02-05T21:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my props and transforms configuration not filtering out events from json data as expected?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-props-and-transforms-configuration-not-filtering-out/m-p/131880#M27126</link>
      <description>&lt;P&gt;Still does not work.  Instead of a blank preview pane I get the message "No results found. Please change Sourcetype, adjust Sourcetype settings, or check your source file."&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2015 21:40:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-props-and-transforms-configuration-not-filtering-out/m-p/131880#M27126</guid>
      <dc:creator>kittle</dc:creator>
      <dc:date>2015-02-05T21:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my props and transforms configuration not filtering out events from json data as expected?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-props-and-transforms-configuration-not-filtering-out/m-p/131881#M27127</link>
      <description>&lt;P&gt;Wondering after changes, if you have added more json files in monitored folder.  Changes will apply to new events only.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2015 21:45:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-props-and-transforms-configuration-not-filtering-out/m-p/131881#M27127</guid>
      <dc:creator>sanjay_shrestha</dc:creator>
      <dc:date>2015-02-05T21:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my props and transforms configuration not filtering out events from json data as expected?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-props-and-transforms-configuration-not-filtering-out/m-p/131882#M27128</link>
      <description>&lt;P&gt;This is using the 'Upload files from my computer' feature, so it always uses new events.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2015 21:49:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-props-and-transforms-configuration-not-filtering-out/m-p/131882#M27128</guid>
      <dc:creator>kittle</dc:creator>
      <dc:date>2015-02-05T21:49:46Z</dc:date>
    </item>
  </channel>
</rss>

