<?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: Create new field for incoming logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366852#M108214</link>
    <description>&lt;P&gt;@swdowiarz, you can try it will help you.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Dec 2017 13:45:11 GMT</pubDate>
    <dc:creator>nikita_p</dc:creator>
    <dc:date>2017-12-27T13:45:11Z</dc:date>
    <item>
      <title>Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366842#M108204</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have some issue with creating field for my logs. I have logs which contain number. I wan extract this number as session_id. First I've indexed data and then I've used "Extract new field", but new logs that are coming don't have this field ? Should I create this field before I extract this data ? &lt;/P&gt;

&lt;P&gt;I would be grateful for some advice. &lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 08:43:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366842#M108204</guid>
      <dc:creator>swdowiarz</dc:creator>
      <dc:date>2017-12-27T08:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366843#M108205</link>
      <description>&lt;P&gt;Did your extraction matched all the session_id pattern you are looking for? &lt;/P&gt;

&lt;P&gt;Could you post some sample logs to see the format of your session_ID?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 08:48:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366843#M108205</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2017-12-27T08:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366844#M108206</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;12/27/17
8:24:49.599 AM  
1514363089599   Groupon   I will do my best to help you, please tell me more about the issue you are having.   
host =instance-1 source =/var/www/html/backend/log_chat/conversation.log

12/27/17
8:24:49.599 AM  
1514363089599   user   i need help   
host =instance-1 source =/var/www/html/backend/log_chat/conversation.log

12/27/17
8:24:49.599 AM  
1514363089599   Groupon   Hello! Thank you for contacting Groupon   
host =instance-1 source =/var/www/html/backend/log_chat/conversation.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;These are examples of my logs and as you can see there is a number the beginning, so I want this number to be my session_id field.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 08:57:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366844#M108206</guid>
      <dc:creator>swdowiarz</dc:creator>
      <dc:date>2017-12-27T08:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366845#M108207</link>
      <description>&lt;P&gt;when you use automatic field extractor there are multiple example of logs, try scrolling down to select the one which you need, else its always easier to use rex command. Please paste the sample log i can help you with the regex required for the rex command.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 08:58:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366845#M108207</guid>
      <dc:creator>kunalmao</dc:creator>
      <dc:date>2017-12-27T08:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366846#M108208</link>
      <description>&lt;P&gt;Hi @swdowiarz,&lt;BR /&gt;
You can also create custom field in index time in transforms.conf.&lt;BR /&gt;
You can check below splunk docs for this.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Data/Configureindex-timefieldextraction"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Data/Configureindex-timefieldextraction&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 09:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366846#M108208</guid>
      <dc:creator>nikita_p</dc:creator>
      <dc:date>2017-12-27T09:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366847#M108209</link>
      <description>&lt;P&gt;so I can use rex command in search instead of extracting new field ? That's good point ! &lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 09:04:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366847#M108209</guid>
      <dc:creator>swdowiarz</dc:creator>
      <dc:date>2017-12-27T09:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366848#M108210</link>
      <description>&lt;P&gt;Hi @nikita_p &lt;/P&gt;

&lt;P&gt;I was thinking about it, but I've heard that is not good idea, that's why I'm asking about it.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 09:06:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366848#M108210</guid>
      <dc:creator>swdowiarz</dc:creator>
      <dc:date>2017-12-27T09:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366849#M108211</link>
      <description>&lt;P&gt;I would think:&lt;BR /&gt;
&lt;CODE&gt;(?&amp;lt;session_id&amp;gt;\d+)\s+\w\w\w&lt;/CODE&gt;&lt;BR /&gt;
would be a good place to start for your regex. Please give that a spin, and let me know how it goes.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 09:09:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366849#M108211</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2017-12-27T09:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366850#M108212</link>
      <description>&lt;P&gt;Hi swdowiarz,&lt;BR /&gt;
at first verify you regex, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?ms)\d+\/\d+\/\d+\s+\d+:\d+:\d+\.\d+\s\w+\s+(?&amp;lt;session_io&amp;gt;\d+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can test it at &lt;A href="https://regex101.com/r/ouA97r/1"&gt;https://regex101.com/r/ouA97r/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;After you can think to extract you fields at index time (see &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Configureindex-timefieldextraction"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Configureindex-timefieldextraction&lt;/A&gt; )&lt;BR /&gt;
 Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 09:10:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366850#M108212</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-12-27T09:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366851#M108213</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;I did what I wanted by this: &lt;CODE&gt;index="chat_bot" source="/var/www/html/backend/log_chat/conversation.log" | rex "^(?P&amp;lt;session_id&amp;gt;\d+)" | dedup session_id | timechart span=1d count&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I've used rex command and now it is working as I wanted so there is no need to do extraction at index time.&lt;BR /&gt;
Thank you all for involvement and help.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 09:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366851#M108213</guid>
      <dc:creator>swdowiarz</dc:creator>
      <dc:date>2017-12-27T09:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366852#M108214</link>
      <description>&lt;P&gt;@swdowiarz, you can try it will help you.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 13:45:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366852#M108214</guid>
      <dc:creator>nikita_p</dc:creator>
      <dc:date>2017-12-27T13:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create new field for incoming logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366853#M108215</link>
      <description>&lt;P&gt;Thanks for posting your answer, so others can see how you accomplished this.  You should also accept the answer, so the question looks closed to others.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 15:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-new-field-for-incoming-logs/m-p/366853#M108215</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-27T15:54:02Z</dc:date>
    </item>
  </channel>
</rss>

