<?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 Couldn't parse and extract mixed data (json and text) in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Couldn-t-parse-and-extract-mixed-data-json-and-text/m-p/469380#M80752</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am not able to send my logfile into 2 sourcetypes (json and non-json). Below is my config. I know the fix might be a simple one. It's just that I am not getting anywhere near it. Need your expertise solution.&lt;/P&gt;

&lt;P&gt;:::::::::::::::::inputs.conf:::::::::::::::: &lt;STRONG&gt;Only 1&lt;/STRONG&gt; monitor stanza is being picked. How can I parse the log file into two source types? Or any better solution? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor://\\server1\sdata$\] 
sourcetype = Custom_W22 
index=0_nojson 
whitelist = (app1.log) 
recursive=false 
interval = 10 
crcSalt = &amp;lt;SOURCE&amp;gt; 


[monitor://\\server1\sdata$] 
sourcetype = myjson 
index=0_myjson 
whitelist = (\app1.log) 
recursive=false 
interval = 10 
crcSalt = &amp;lt;SOURCE&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;::::::::::::props.conf:::::::::::::::::::::::::::::: &lt;BR /&gt;
-----Here I have used current DATETIME_CONFIG which ignores my timestamps. I can fix the timestamps after indexing. Otherwise, the parsing was slow--------- &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Custom_W22] 
NO_BINARY_CHECK = true 
SHOULD_LINEMERGE = false 
category = Miscellaneous 
TRANSFORMS-set = discardAll,queue2resp
disabled = false 
pulldown_type = true 
DATETIME_CONFIG = CURRENT 
TRUNCATE = 100000 

[myjson] 
SEDCMD-strip_prefix = s/^[^{]+//g 
INDEXED_EXTRACTIONS=JSON 
NO_BINARY_CHECK = true 
category = Custom 
description = myjson custom 
disabled = false 
pulldown_type = true 
TRUNCATE = 100000 
MAX_EVENTS = 10000 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;::::::::::::::::::transforms.conf:::::::::::::::::::::::::: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[discardAll] 
REGEX=. 
DEST_KEY=queue 
FORMAT=nullQueue 

[queue2resp] 
REGEX=(\&amp;lt;Tracker\s+\[pointer) 
DEST_KEY=queue 
FORMAT=indexQueue 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 30 Aug 2019 02:06:28 GMT</pubDate>
    <dc:creator>nareshinsvu</dc:creator>
    <dc:date>2019-08-30T02:06:28Z</dc:date>
    <item>
      <title>Couldn't parse and extract mixed data (json and text)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Couldn-t-parse-and-extract-mixed-data-json-and-text/m-p/469380#M80752</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am not able to send my logfile into 2 sourcetypes (json and non-json). Below is my config. I know the fix might be a simple one. It's just that I am not getting anywhere near it. Need your expertise solution.&lt;/P&gt;

&lt;P&gt;:::::::::::::::::inputs.conf:::::::::::::::: &lt;STRONG&gt;Only 1&lt;/STRONG&gt; monitor stanza is being picked. How can I parse the log file into two source types? Or any better solution? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor://\\server1\sdata$\] 
sourcetype = Custom_W22 
index=0_nojson 
whitelist = (app1.log) 
recursive=false 
interval = 10 
crcSalt = &amp;lt;SOURCE&amp;gt; 


[monitor://\\server1\sdata$] 
sourcetype = myjson 
index=0_myjson 
whitelist = (\app1.log) 
recursive=false 
interval = 10 
crcSalt = &amp;lt;SOURCE&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;::::::::::::props.conf:::::::::::::::::::::::::::::: &lt;BR /&gt;
-----Here I have used current DATETIME_CONFIG which ignores my timestamps. I can fix the timestamps after indexing. Otherwise, the parsing was slow--------- &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Custom_W22] 
NO_BINARY_CHECK = true 
SHOULD_LINEMERGE = false 
category = Miscellaneous 
TRANSFORMS-set = discardAll,queue2resp
disabled = false 
pulldown_type = true 
DATETIME_CONFIG = CURRENT 
TRUNCATE = 100000 

[myjson] 
SEDCMD-strip_prefix = s/^[^{]+//g 
INDEXED_EXTRACTIONS=JSON 
NO_BINARY_CHECK = true 
category = Custom 
description = myjson custom 
disabled = false 
pulldown_type = true 
TRUNCATE = 100000 
MAX_EVENTS = 10000 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;::::::::::::::::::transforms.conf:::::::::::::::::::::::::: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[discardAll] 
REGEX=. 
DEST_KEY=queue 
FORMAT=nullQueue 

[queue2resp] 
REGEX=(\&amp;lt;Tracker\s+\[pointer) 
DEST_KEY=queue 
FORMAT=indexQueue 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Aug 2019 02:06:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Couldn-t-parse-and-extract-mixed-data-json-and-text/m-p/469380#M80752</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2019-08-30T02:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Couldn't parse and extract mixed data (json and text)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Couldn-t-parse-and-extract-mixed-data-json-and-text/m-p/469381#M80753</link>
      <description>&lt;P&gt;@nareshinsvu Please go through the following document and let me know if it helps!&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.2.0/Data/Advancedsourcetypeoverrides"&gt;https://docs.splunk.com/Documentation/Splunk/6.2.0/Data/Advancedsourcetypeoverrides&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 04:27:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Couldn-t-parse-and-extract-mixed-data-json-and-text/m-p/469381#M80753</guid>
      <dc:creator>sandyIscream</dc:creator>
      <dc:date>2019-08-30T04:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Couldn't parse and extract mixed data (json and text)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Couldn-t-parse-and-extract-mixed-data-json-and-text/m-p/469382#M80754</link>
      <description>&lt;P&gt;Hi @sandyIscream - This doesn't help as myjson of my props doesn't need transforms.conf. So, I cant use transforms regex and seperate json events to a different index / sourcetype.&lt;/P&gt;

&lt;P&gt;A working example of the config will actually help me to try and test&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 05:44:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Couldn-t-parse-and-extract-mixed-data-json-and-text/m-p/469382#M80754</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2019-08-30T05:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Couldn't parse and extract mixed data (json and text)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Couldn-t-parse-and-extract-mixed-data-json-and-text/m-p/469383#M80755</link>
      <description>&lt;P&gt;More observations:&lt;BR /&gt;
1)&lt;BR /&gt;
Both the stanzas work fine if the source logfile is different. My requirement is that I need ONE logfile parsed to TWO sourcetypes.&lt;/P&gt;

&lt;P&gt;2) While testing JSON data alone, found that &lt;CODE&gt;"crcSalt = &amp;lt;SOURCE&amp;gt; "&lt;/CODE&gt; is not working. A new line addition at the tail of the log is re-indexing the whole log and duplicating my splunk events. &lt;BR /&gt;
I am able to fix it by using below config. Need to know if there are any drawbacks with this approach in the future? Note: followTail is working fine even if the logfile gets archived and a new file with same name gets created.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;crcSalt = &amp;lt;SOURCE&amp;gt;
followTail = 1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Aug 2019 05:50:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Couldn-t-parse-and-extract-mixed-data-json-and-text/m-p/469383#M80755</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2019-08-30T05:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Couldn't parse and extract mixed data (json and text)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Couldn-t-parse-and-extract-mixed-data-json-and-text/m-p/469384#M80756</link>
      <description>&lt;P&gt;:::::::::::::::::::Work around::::::::::::&lt;/P&gt;

&lt;P&gt;Monitor JSON of 1.log - configure input, props and transforms at Forwarder end to push data to the Indexer&lt;BR /&gt;
Monitor Non-json of same 1.log - configure input, props and transforms at Indexer end to pull data from Forwarder&lt;/P&gt;

&lt;P&gt;I am not sure if this a recommended approach. Splunkexperts - please suggest&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 06:21:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Couldn-t-parse-and-extract-mixed-data-json-and-text/m-p/469384#M80756</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2019-09-03T06:21:56Z</dc:date>
    </item>
  </channel>
</rss>

