<?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 Sourcetype not being applied in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-not-being-applied/m-p/557046#M92169</link>
    <description>&lt;DIV class="usertext-body may-blank-within md-container "&gt;&lt;DIV class="md"&gt;&lt;DIV class="usertext-body may-blank-within md-container "&gt;&lt;DIV class="md"&gt;&lt;P&gt;Hi everyone. I'm using Splunk Enterprise (Trial) to understand how things works.&lt;/P&gt;&lt;P&gt;I'm trying to configure some sourcetype for my python/flask application, logs where getting merged incorrectly, with two or more line logs being joined inside a single event and sourcetype is not being applied.&lt;/P&gt;&lt;P&gt;For example, this is a single event in splunk:&lt;/P&gt;&lt;PRE&gt;[2021-06-23 12:05:09,807] {/program.py:make_request:452} DEBUG - https://localhost:443 "POST /create/user HTTP/1.1" 201 None
[2021-06-23 12:05:09,810] {/program.py:make_request:493} INFO - user created with success id=1234&lt;/PRE&gt;&lt;P&gt;I also have some logs with this format:&lt;/P&gt;&lt;PRE&gt;[2021-06-24 17:48:37,490] {/program/main.py:authorize:69} INFO - Host: localhost:5000
  User-Agent: curl/7.64.0
  Accept: */*&lt;/PRE&gt;&lt;P&gt;I tried creating a new sourcetype on Settings-&amp;gt;Data-&amp;gt;Source Types. But I noticed two weird things.&lt;/P&gt;&lt;P&gt;1 - If I go on Advanced and configure as I want, It don't save my new regex for &lt;STRONG&gt;LINE_BREAKER&lt;/STRONG&gt;. I need it to be: &lt;STRONG&gt;([\n\r]+)[&lt;/STRONG&gt; but every time I press save, and open again, its the default one &lt;STRONG&gt;([\n\r]+)&lt;/STRONG&gt;. If I go on "Events Break" instead and just type my regex it saves. What I'm doing wrong?&lt;/P&gt;&lt;P&gt;2 - It doesn't apply my new sourcetype to my logs. I check on Search-&amp;gt;Event lists and my logs are being sourcetyped as &lt;STRONG&gt;output-too_small&lt;/STRONG&gt;, now I changed something and it is &lt;STRONG&gt;output-2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then, I started googling around, and reading some docs, they tell to edit some files on splunk server then I did:&lt;/P&gt;&lt;P&gt;3 - Also tried creating a new sourcetype on &lt;STRONG&gt;$SPUNK_HOME/etc/system/local/props.conf&lt;/STRONG&gt; as follow:&lt;/P&gt;&lt;PRE&gt;[python_flask]
SHOULD_LINEMERGE = False
LINE_BREAKER = ([\n\r]+)\[
NO_BINARY_CHECK = true
disabled = false&lt;/PRE&gt;&lt;P&gt;4 - Also changed my &lt;STRONG&gt;$SPUNK_HOME/etc/system/local/inputs.conf&lt;/STRONG&gt;, and added:&lt;/P&gt;&lt;PRE&gt;[monitor:///var/log/program/output.log]
sourcetype = python_flask&lt;/PRE&gt;&lt;P&gt;I restarted with &lt;STRONG&gt;splunk restart&lt;/STRONG&gt; both server and universal forwarder, and the only thing that changed is that it started to put &lt;STRONG&gt;sourcetype=output-2&lt;/STRONG&gt; on my events .&lt;/P&gt;&lt;P&gt;I'm quite noob in splunk management, so sorry if any question is dumb, I have already checked the docs, google and so on. Thank you so much in advance.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 24 Jun 2021 18:56:38 GMT</pubDate>
    <dc:creator>gabrsar</dc:creator>
    <dc:date>2021-06-24T18:56:38Z</dc:date>
    <item>
      <title>Sourcetype not being applied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-not-being-applied/m-p/557046#M92169</link>
      <description>&lt;DIV class="usertext-body may-blank-within md-container "&gt;&lt;DIV class="md"&gt;&lt;DIV class="usertext-body may-blank-within md-container "&gt;&lt;DIV class="md"&gt;&lt;P&gt;Hi everyone. I'm using Splunk Enterprise (Trial) to understand how things works.&lt;/P&gt;&lt;P&gt;I'm trying to configure some sourcetype for my python/flask application, logs where getting merged incorrectly, with two or more line logs being joined inside a single event and sourcetype is not being applied.&lt;/P&gt;&lt;P&gt;For example, this is a single event in splunk:&lt;/P&gt;&lt;PRE&gt;[2021-06-23 12:05:09,807] {/program.py:make_request:452} DEBUG - https://localhost:443 "POST /create/user HTTP/1.1" 201 None
[2021-06-23 12:05:09,810] {/program.py:make_request:493} INFO - user created with success id=1234&lt;/PRE&gt;&lt;P&gt;I also have some logs with this format:&lt;/P&gt;&lt;PRE&gt;[2021-06-24 17:48:37,490] {/program/main.py:authorize:69} INFO - Host: localhost:5000
  User-Agent: curl/7.64.0
  Accept: */*&lt;/PRE&gt;&lt;P&gt;I tried creating a new sourcetype on Settings-&amp;gt;Data-&amp;gt;Source Types. But I noticed two weird things.&lt;/P&gt;&lt;P&gt;1 - If I go on Advanced and configure as I want, It don't save my new regex for &lt;STRONG&gt;LINE_BREAKER&lt;/STRONG&gt;. I need it to be: &lt;STRONG&gt;([\n\r]+)[&lt;/STRONG&gt; but every time I press save, and open again, its the default one &lt;STRONG&gt;([\n\r]+)&lt;/STRONG&gt;. If I go on "Events Break" instead and just type my regex it saves. What I'm doing wrong?&lt;/P&gt;&lt;P&gt;2 - It doesn't apply my new sourcetype to my logs. I check on Search-&amp;gt;Event lists and my logs are being sourcetyped as &lt;STRONG&gt;output-too_small&lt;/STRONG&gt;, now I changed something and it is &lt;STRONG&gt;output-2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then, I started googling around, and reading some docs, they tell to edit some files on splunk server then I did:&lt;/P&gt;&lt;P&gt;3 - Also tried creating a new sourcetype on &lt;STRONG&gt;$SPUNK_HOME/etc/system/local/props.conf&lt;/STRONG&gt; as follow:&lt;/P&gt;&lt;PRE&gt;[python_flask]
SHOULD_LINEMERGE = False
LINE_BREAKER = ([\n\r]+)\[
NO_BINARY_CHECK = true
disabled = false&lt;/PRE&gt;&lt;P&gt;4 - Also changed my &lt;STRONG&gt;$SPUNK_HOME/etc/system/local/inputs.conf&lt;/STRONG&gt;, and added:&lt;/P&gt;&lt;PRE&gt;[monitor:///var/log/program/output.log]
sourcetype = python_flask&lt;/PRE&gt;&lt;P&gt;I restarted with &lt;STRONG&gt;splunk restart&lt;/STRONG&gt; both server and universal forwarder, and the only thing that changed is that it started to put &lt;STRONG&gt;sourcetype=output-2&lt;/STRONG&gt; on my events .&lt;/P&gt;&lt;P&gt;I'm quite noob in splunk management, so sorry if any question is dumb, I have already checked the docs, google and so on. Thank you so much in advance.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 Jun 2021 18:56:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-not-being-applied/m-p/557046#M92169</guid>
      <dc:creator>gabrsar</dc:creator>
      <dc:date>2021-06-24T18:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sourcetype not being applied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-not-being-applied/m-p/557658#M92290</link>
      <description>&lt;P&gt;Check the permissions on the props.conf that you created. I'm going to guess it's owned by root (or another user) and Splunk can't access it. If you are running Splunk as the splunk user you'll need to chmod splunk:splunk $SPUNK_HOME/etc/system/local/props.conf (e.g.) and then cycle Splunk.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 18:16:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-not-being-applied/m-p/557658#M92290</guid>
      <dc:creator>codebuilder</dc:creator>
      <dc:date>2021-06-29T18:16:36Z</dc:date>
    </item>
  </channel>
</rss>

