<?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: change index for some events in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507850#M86427</link>
    <description>Why are you trying to put all 404s in a separate index? What problem do you expect that to solve?</description>
    <pubDate>Tue, 07 Jul 2020 14:03:58 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-07-07T14:03:58Z</dc:date>
    <item>
      <title>change index for some events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507845#M86424</link>
      <description>&lt;P&gt;Hello splunkers. I am new to splunk and have a question on how to change index for events that e.g. have status 404 on index time?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;props.conf&amp;nbsp;&lt;/P&gt;&lt;P&gt;[weblogs]&lt;BR /&gt;LINE_BREAKER = (&amp;amp;&amp;amp;&amp;amp;)&lt;BR /&gt;NO_BINARY_CHECK = true&lt;BR /&gt;REPORT-access = access-extractions&lt;BR /&gt;SHOULD_LINEMERGE = false&lt;BR /&gt;maxDist = 28&lt;BR /&gt;...&lt;BR /&gt;TRANSFORMS-change = notfound,changesourcetype&lt;/P&gt;&lt;P&gt;transforms.conf&lt;/P&gt;&lt;P&gt;[notfound]&lt;BR /&gt;REGEX = ".+?"\s(404)&lt;BR /&gt;DEST_KEY = MetaData:Index&lt;BR /&gt;FORMAT = index::notfoundindex&lt;/P&gt;&lt;P&gt;[changesourcetype]&lt;BR /&gt;DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;REGEX = ^(.*)&lt;BR /&gt;FORMAT = sourcetype::access_combined&lt;/P&gt;&lt;P&gt;example of event:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;&lt;SPAN class="t h"&gt;141&lt;/SPAN&gt;.146.8.66&lt;/SPAN&gt; &lt;SPAN class="t"&gt;-&lt;/SPAN&gt; &lt;SPAN class="t"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN class="t"&gt;13/Jan/2016&lt;/SPAN&gt; &lt;SPAN class="t"&gt;21:03:09:200&lt;/SPAN&gt;&lt;SPAN&gt;] "&lt;/SPAN&gt;&lt;SPAN class="t"&gt;POST&lt;/SPAN&gt; &lt;SPAN class="t"&gt;/category.screen&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;SPAN class="t"&gt;category_id=SURPRISE&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;JSESSIONID=SD1SL2FF5ADFF3&lt;/SPAN&gt; &lt;SPAN class="t"&gt;HTTP&lt;/SPAN&gt; &lt;SPAN class="t"&gt;1.1&lt;/SPAN&gt;&lt;SPAN&gt;" &lt;/SPAN&gt;&lt;SPAN class="t"&gt;200&lt;/SPAN&gt; &lt;SPAN class="t"&gt;3496&lt;/SPAN&gt;&lt;SPAN&gt; "&lt;/SPAN&gt;&lt;SPAN class="t"&gt;&lt;A href="http://www.myflowershop.com/cart.do" target="_blank" rel="noopener"&gt;http://www.myflowershop.com/cart.do&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;SPAN class="t"&gt;action=view&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;itemId=EST-16&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;product_id=RP-SN-01&lt;/SPAN&gt;&lt;SPAN&gt;" "&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Mozilla/5.0&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Macintosh&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN class="t"&gt;U&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN class="t"&gt;Intel&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Mac&lt;/SPAN&gt; &lt;SPAN class="t"&gt;OS&lt;/SPAN&gt; &lt;SPAN class="t"&gt;X&lt;/SPAN&gt; &lt;SPAN class="t"&gt;10_6_3&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN class="t"&gt;en-US&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN class="t"&gt;AppleWebKit/533.4&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class="t"&gt;KHTML&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class="t"&gt;like&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Gecko&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN class="t"&gt;Chrome/5.0.375.38&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Safari/533.4&lt;/SPAN&gt;&lt;SPAN&gt;" &lt;/SPAN&gt;&lt;SPAN class="t"&gt;294&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing of sourcetype works fine, but index changing doesn't and I really do not know where the mistake is.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 13:43:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507845#M86424</guid>
      <dc:creator>yudzhin</dc:creator>
      <dc:date>2020-07-07T13:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: change index for some events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507849#M86426</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223355"&gt;@yudzhin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;At first I don't understand why you want to put 404 events in a different index!&lt;/P&gt;&lt;P&gt;Remember that usually in Splunk are used different indexes basing on two parameters:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;different grants of access,&lt;/LI&gt;&lt;LI&gt;different retention periods.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can differentiate events using sourcetype or another field, don't think to Splunk as a DB table with fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, I see two things probably not correct:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;in props.conf, you're using two transformations in one command, I prefer to use two different transformations:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TRANSFORMS-notfound = notfound
TRANSFORMS-change = changesourcetype&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I cannot check the regex in notfound stanza, but I don't see, in your sample, anything that could be matched by that regex, could you share a sample with 404?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Anyway, if in your sample 200 is the posizion of 404, you could try this regex in notfound stanza&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\"\s+404\s+&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 14:08:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507849#M86426</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-07-07T14:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: change index for some events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507850#M86427</link>
      <description>Why are you trying to put all 404s in a separate index? What problem do you expect that to solve?</description>
      <pubDate>Tue, 07 Jul 2020 14:03:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507850#M86427</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-07T14:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: change index for some events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507851#M86428</link>
      <description>&lt;P class="lia-align-left"&gt;Hello &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; and thank's for response.&lt;/P&gt;&lt;P class="lia-align-left"&gt;example of event with 404&lt;BR /&gt;69.80.0.18 - - [13/Jan/2016 21:03:08:169] "GET /product.screen?product_id=K9-CW-01&amp;amp;JSESSIONID=SD7SL2FF10ADFF4 HTTP 1.1" 404 2038 "&lt;A href="http://www.myflowershop.com/cart.do?action=view&amp;amp;itemId=EST-1&amp;amp;product_id=K9-CW-01" target="_blank" rel="noopener"&gt;http://www.myflowershop.com/cart.do?action=view&amp;amp;itemId=EST-1&amp;amp;product_id=K9-CW-01&lt;/A&gt;" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" 261&lt;/P&gt;&lt;P class="lia-align-left"&gt;Unfortunatelly changing both regex and separate TRANSFORMS didn't help, after data is uploaded all events are present for webindex, not for notfoundindex.&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;BTW: I am doing some labs for SE2 certification and I have such task. I understand this has no sense, but I have to do&amp;nbsp; it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 14:11:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507851#M86428</guid>
      <dc:creator>yudzhin</dc:creator>
      <dc:date>2020-07-07T14:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: change index for some events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507853#M86430</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223355"&gt;@yudzhin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the regex I hinted is correct so try it.&lt;/P&gt;&lt;P&gt;To debug your problem, try if each transformation runs by itself.&lt;/P&gt;&lt;P&gt;Anyway, thinks to your idea to have different indexes!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 14:10:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507853#M86430</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-07-07T14:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: change index for some events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507854#M86431</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;I have to do some labs and there is a task to do so &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 14:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507854#M86431</guid>
      <dc:creator>yudzhin</dc:creator>
      <dc:date>2020-07-07T14:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: change index for some events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507856#M86432</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&amp;nbsp;TRANSFORMS-notfound = notfound is not working separately.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 14:17:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507856#M86432</guid>
      <dc:creator>yudzhin</dc:creator>
      <dc:date>2020-07-07T14:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: change index for some events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507863#M86433</link>
      <description>&lt;P&gt;Problem solved just by re-typing transforms.conf stanzas, most probably some unexpected character was present.&lt;BR /&gt;thank's all for help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 14:58:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/change-index-for-some-events/m-p/507863#M86433</guid>
      <dc:creator>yudzhin</dc:creator>
      <dc:date>2020-07-07T14:58:38Z</dc:date>
    </item>
  </channel>
</rss>

