<?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: How to format raw events into splunk table when the events are already in tabular format in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-format-raw-events-into-splunk-table-when-the-events-are/m-p/508408#M86504</link>
    <description>&lt;P&gt;Firstly your where clause needs "STOP" to be quoted, as it's an eval statement, not a search, so it thinks STOP is a fieldname.&lt;/P&gt;&lt;P&gt;However, it still won't work as the STOP has a space prefix. You can replace the second rex statement with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw mode=sed "s/([\s]* ,|, )/,/g"&lt;/LI-CODE&gt;&lt;P&gt;i.e. adding a second clause to remove the space at the start of the field name&lt;/P&gt;&lt;P&gt;Should work&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jul 2020 21:50:12 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2020-07-09T21:50:12Z</dc:date>
    <item>
      <title>How to format raw events into splunk table when the events are already in tabular format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-format-raw-events-into-splunk-table-when-the-events-are/m-p/507745#M86411</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I have following data coming into splunk in one event and i want these event to be formatted in proper splunk table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;200&lt;/SPAN&gt; &lt;SPAN class="t"&gt;-&lt;/SPAN&gt; &lt;SPAN class="t"&gt;OK&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------&lt;SPAN class="t"&gt;-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;| &lt;SPAN class="t"&gt;LM&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;GRP&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt; |&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN class="t"&gt;SR&amp;nbsp;&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;ID&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;| &lt;SPAN class="t"&gt;STATE&lt;/SPAN&gt;&amp;nbsp; | &lt;SPAN class="t"&gt;SDL&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;QUEUE&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;SK&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;FAIL&lt;/SPAN&gt; |&lt;/P&gt;&lt;P&gt;|------------------------------------------------------------------------------------------&lt;SPAN class="t"&gt;-&lt;/SPAN&gt;|&lt;/P&gt;&lt;P&gt;| &lt;SPAN class="t"&gt;gpp1&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;GROUP&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;hv&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;231&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;START&lt;/SPAN&gt; | --&lt;SPAN class="t"&gt;-&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;HV&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;15272&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;1&lt;/SPAN&gt; |&lt;/P&gt;&lt;P&gt;| &lt;SPAN class="t"&gt;gpp2&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;GROUP&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;hv&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;233&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;START&lt;/SPAN&gt; | --&lt;SPAN class="t"&gt;-&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;HV&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;15226&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;2&lt;/SPAN&gt; |&lt;/P&gt;&lt;P&gt;| &lt;SPAN class="t"&gt;gpp2&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;GROUP&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;hv&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;234&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;START&lt;/SPAN&gt; | --&lt;SPAN class="t"&gt;-&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;HV&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;11546&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;2&lt;/SPAN&gt; |&lt;/P&gt;&lt;P&gt;| &lt;SPAN class="t"&gt;gpp1&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;GROUP&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;hq&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;240&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;STOP&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp;| --&lt;SPAN class="t"&gt;-&lt;/SPAN&gt; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &lt;SPAN class="t"&gt;0&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &lt;SPAN class="t"&gt;1&lt;/SPAN&gt; |&lt;/P&gt;&lt;P&gt;| &lt;SPAN class="t"&gt;gpp2&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;GROUP&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;hq&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;242&lt;/SPAN&gt;&amp;nbsp;| &lt;SPAN class="t"&gt;START&lt;/SPAN&gt; | --&lt;SPAN class="t"&gt;-&lt;/SPAN&gt; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &lt;SPAN class="t"&gt;0&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &lt;SPAN class="t"&gt;1&lt;/SPAN&gt; |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i want to create fields with above table headers like LM,GRP,ID,STATE,etc. and these fields should consist all the values present underneath it&lt;/P&gt;&lt;P&gt;I tried extracting the fields and also used multikv command but no luck.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 06:02:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-format-raw-events-into-splunk-table-when-the-events-are/m-p/507745#M86411</guid>
      <dc:creator>ak9092</dc:creator>
      <dc:date>2020-07-07T06:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to format raw events into splunk table when the events are already in tabular format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-format-raw-events-into-splunk-table-when-the-events-are/m-p/507770#M86416</link>
      <description>&lt;P&gt;This will create many rows for each event, but may help you get where you're going - it pre-massages the data before the multikv&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="200 - OK 

---------------------------------------------------------------------------------------------

| LM      | GRP    |    SR  | ID     | STATE  | SDL | QUEUE | SK | FAIL |

|-------------------------------------------------------------------------------------------|

| gpp1 | GROUP | hv | 231 | START | --- | HV | 15272 | 1 |

| gpp2 | GROUP | hv | 233 | START | --- | HV | 15226 | 2 |

| gpp2 | GROUP | hv | 234 | START | --- | HV | 11546 | 2 |

| gpp1 | GROUP | hq | 240 | STOP   | --- |        | 0             | 1 |

| gpp2 | GROUP | hq | 242 | START | --- |        | 0             | 1 |"
| eval t=replace(_raw,"\n", ",")
| eval rows=split(t,",")
| eval cr=mvcount(_raw), ct=mvcount(rows)
| fields - t
| eval _raw=rows
| rex field=_raw mode=sed "s/ \|/,/g"
| rex field=_raw mode=sed "s/[\s]* ,/,/g"
| multikv forceheader=3
| table LM GRP SR ID STATE SDL QUEUE SK FAIL&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 07:51:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-format-raw-events-into-splunk-table-when-the-events-are/m-p/507770#M86416</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-07-07T07:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to format raw events into splunk table when the events are already in tabular format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-format-raw-events-into-splunk-table-when-the-events-are/m-p/508232#M86488</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;, this seems to be doing the trick but i am unable to filter events by any of that extracted fields.&lt;/P&gt;&lt;P&gt;So for Example - i want to get event which are in STOP state, but when i tried executing below query it didn't returned any results&lt;/P&gt;&lt;P&gt;....|table&amp;nbsp;LM GRP SR ID STATE SDL QUEUE SK FAIL | where STATE=STOP&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 06:09:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-format-raw-events-into-splunk-table-when-the-events-are/m-p/508232#M86488</guid>
      <dc:creator>ak9092</dc:creator>
      <dc:date>2020-07-09T06:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to format raw events into splunk table when the events are already in tabular format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-format-raw-events-into-splunk-table-when-the-events-are/m-p/508408#M86504</link>
      <description>&lt;P&gt;Firstly your where clause needs "STOP" to be quoted, as it's an eval statement, not a search, so it thinks STOP is a fieldname.&lt;/P&gt;&lt;P&gt;However, it still won't work as the STOP has a space prefix. You can replace the second rex statement with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw mode=sed "s/([\s]* ,|, )/,/g"&lt;/LI-CODE&gt;&lt;P&gt;i.e. adding a second clause to remove the space at the start of the field name&lt;/P&gt;&lt;P&gt;Should work&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 21:50:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-format-raw-events-into-splunk-table-when-the-events-are/m-p/508408#M86504</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-07-09T21:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to format raw events into splunk table when the events are already in tabular format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-format-raw-events-into-splunk-table-when-the-events-are/m-p/508467#M86508</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;perfect ..Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 12:06:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-format-raw-events-into-splunk-table-when-the-events-are/m-p/508467#M86508</guid>
      <dc:creator>ak9092</dc:creator>
      <dc:date>2020-07-10T12:06:19Z</dc:date>
    </item>
  </channel>
</rss>

