<?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 Setting fields from logs with different row values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Setting-fields-from-logs-with-different-row-values/m-p/158730#M44747</link>
    <description>&lt;P&gt;Hello everybody,&lt;/P&gt;

&lt;P&gt;I have a question that might have been responded before but I have a log file from a server that looks like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10:01pm load_disk:  200
10:01pm sessions: 2
10:01pm maxpage: 201
10:01pm datadisk: 30
10:01pm memory: 10
10:02pm load_disk:201
10:02pm sessions: 3
10:02pm maxpage: 202
10:02pm datadisk: 31
10:02pm memory: 11
....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you can see, it is a log file that shows many different values on each row but the values repeat (in this case) every 5 rows. I would like to extract a field for each line that defines a log:&lt;BR /&gt;
field1 -&amp;gt; load_disk&lt;BR /&gt;
field2 -&amp;gt; sessions&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;When I try to extract using the Extract Field option in the search, it does not show me all the lines of the log ( this log has a huge number of lines that are different and repeat ) maybe because of window size but I cannot see all the lines of the log (before repeating). &lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Juan&lt;/P&gt;</description>
    <pubDate>Fri, 10 Oct 2014 07:45:24 GMT</pubDate>
    <dc:creator>juancarlos_pola</dc:creator>
    <dc:date>2014-10-10T07:45:24Z</dc:date>
    <item>
      <title>Setting fields from logs with different row values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-fields-from-logs-with-different-row-values/m-p/158730#M44747</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;

&lt;P&gt;I have a question that might have been responded before but I have a log file from a server that looks like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10:01pm load_disk:  200
10:01pm sessions: 2
10:01pm maxpage: 201
10:01pm datadisk: 30
10:01pm memory: 10
10:02pm load_disk:201
10:02pm sessions: 3
10:02pm maxpage: 202
10:02pm datadisk: 31
10:02pm memory: 11
....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you can see, it is a log file that shows many different values on each row but the values repeat (in this case) every 5 rows. I would like to extract a field for each line that defines a log:&lt;BR /&gt;
field1 -&amp;gt; load_disk&lt;BR /&gt;
field2 -&amp;gt; sessions&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;When I try to extract using the Extract Field option in the search, it does not show me all the lines of the log ( this log has a huge number of lines that are different and repeat ) maybe because of window size but I cannot see all the lines of the log (before repeating). &lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Juan&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2014 07:45:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-fields-from-logs-with-different-row-values/m-p/158730#M44747</guid>
      <dc:creator>juancarlos_pola</dc:creator>
      <dc:date>2014-10-10T07:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Setting fields from logs with different row values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-fields-from-logs-with-different-row-values/m-p/158731#M44748</link>
      <description>&lt;P&gt;I do not completely understand your question. Do you want to put all fields, in this case load_disk, sessions, maxpage, datadisk and memory on one row?&lt;/P&gt;

&lt;P&gt;So you want to gor from your example to something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10:01pm load_disk: 200, sessions: 2, maxpage: 201, datadisk: 30, memory: 10
10:02pm load_disk: 201, sessions: 3, maxpage: 202, datadisk: 31, memory: 11
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Oct 2014 09:43:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-fields-from-logs-with-different-row-values/m-p/158731#M44748</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2014-10-10T09:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Setting fields from logs with different row values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-fields-from-logs-with-different-row-values/m-p/158732#M44749</link>
      <description>&lt;P&gt;Hello Tom,&lt;/P&gt;

&lt;P&gt;Thank you for your reply and I am sorry for the long silence.&lt;/P&gt;

&lt;P&gt;What I actually wanted from the previous log was to set a field for each log variable as follows:&lt;/P&gt;

&lt;P&gt;field1 = load_disk&lt;BR /&gt;
field2 = sessions&lt;BR /&gt;
field3 = maxpage&lt;BR /&gt;
field4 = datadisk&lt;BR /&gt;
field5 = memory&lt;/P&gt;

&lt;P&gt;so I can draw a line chart with all these fields inside one chart:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=/admin/server/* | timechart first(field1) first(field2) avg(field3) first(field4) avg(field5)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My issue now is that the REAL log has more than 80 different variables and they repeat every 10 minutes, so I would like to set a field for each log variable. I saw some usage of the regex editor but I am quite new in Splunk so I would like some advice or if you have had previous experience with such kind of log files&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 04:49:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-fields-from-logs-with-different-row-values/m-p/158732#M44749</guid>
      <dc:creator>juancarlos_pola</dc:creator>
      <dc:date>2014-10-14T04:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Setting fields from logs with different row values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-fields-from-logs-with-different-row-values/m-p/158733#M44750</link>
      <description>&lt;P&gt;You could do this:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;in props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetypehere]
REPORT-eaf=extract-all-fields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;in transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extract-all-fields]
FORMAT = $1::$2
REGEX  = (\S+?)\s*:\s*(\S+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should give you all the field extractions. &lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 05:09:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-fields-from-logs-with-different-row-values/m-p/158733#M44750</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-10-14T05:09:36Z</dc:date>
    </item>
  </channel>
</rss>

