<?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: Converting a sql case statement into different events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Converting-a-sql-case-statement-into-different-events/m-p/68415#M17135</link>
    <description>&lt;P&gt;I am not sure that I understand your question. So I will rephrase it like this:&lt;/P&gt;

&lt;P&gt;"I loaded this table into Splunk, but Splunk put all the data into a single event. I need to treat each line as a separate event."&lt;/P&gt;

&lt;P&gt;First, I suggest that you ask Splunk to break this data up when it is brought into Splunk. You can do this with the configuration file &lt;CODE&gt;props.conf&lt;/CODE&gt; Put it on your indexer in &lt;CODE&gt;$SPLUNK_HOME/etc/system/local&lt;/CODE&gt;. (You can also put it in the same directory as your &lt;CODE&gt;inputs.conf&lt;/CODE&gt; if you are not using a forwarder).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/your/file/name/here]
SHOULD_LINEMERGE = false
DATETIME_CONFIG = NONE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that this configuration is NOT retroactive, so you will need to remove and re-index this file.&lt;/P&gt;

&lt;P&gt;Once you have done that, it should be a simple matter to set up the fields (I suggest the Interactive Field Extractor). After that, you will be able to run statistics, etc.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=/your/file/name/here
| table Case speed   strength  weight  height 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Mar 2013 19:14:54 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2013-03-20T19:14:54Z</dc:date>
    <item>
      <title>Converting a sql case statement into different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-a-sql-case-statement-into-different-events/m-p/68414#M17134</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I'm hoping someone can help me I currently have some queries I run that I can looking to automate into Splunk. One of them in particular involves a case statement that has different outcomes when I change this to run in Splunk it puts it all onto one line treating it as one event is there any way to display this in splunk? Some sample data is below:&lt;/P&gt;

&lt;P&gt;Case            speed   strength  weight  height&lt;BR /&gt;
Person 1    100    130     70      50&lt;BR /&gt;
Person 2    120    100     80      55&lt;BR /&gt;
Person 3    150    150     80      60&lt;BR /&gt;
Person 4    70     90      70      65&lt;BR /&gt;
Person 5    60     30      90      70&lt;BR /&gt;
Person 6    20     100     100     75&lt;/P&gt;

&lt;P&gt;So for the sample output of this query in splunk key pair values would be like:&lt;/P&gt;

&lt;P&gt;Wed Mar 20 14:00:01 GMT 2013 Case="Person1"speed="100"strength="130"weight="70"height="50" Case="Person2"speed="120"strength="100"weight="80"height="55"&lt;/P&gt;

&lt;P&gt;I now want to search this in splunk and compare the values of each person together i.e speed vs speed etc.&lt;/P&gt;

&lt;P&gt;Is this possible? Any help would be appreciated&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2013 17:35:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-a-sql-case-statement-into-different-events/m-p/68414#M17134</guid>
      <dc:creator>swilson91</dc:creator>
      <dc:date>2013-03-20T17:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a sql case statement into different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-a-sql-case-statement-into-different-events/m-p/68415#M17135</link>
      <description>&lt;P&gt;I am not sure that I understand your question. So I will rephrase it like this:&lt;/P&gt;

&lt;P&gt;"I loaded this table into Splunk, but Splunk put all the data into a single event. I need to treat each line as a separate event."&lt;/P&gt;

&lt;P&gt;First, I suggest that you ask Splunk to break this data up when it is brought into Splunk. You can do this with the configuration file &lt;CODE&gt;props.conf&lt;/CODE&gt; Put it on your indexer in &lt;CODE&gt;$SPLUNK_HOME/etc/system/local&lt;/CODE&gt;. (You can also put it in the same directory as your &lt;CODE&gt;inputs.conf&lt;/CODE&gt; if you are not using a forwarder).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/your/file/name/here]
SHOULD_LINEMERGE = false
DATETIME_CONFIG = NONE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that this configuration is NOT retroactive, so you will need to remove and re-index this file.&lt;/P&gt;

&lt;P&gt;Once you have done that, it should be a simple matter to set up the fields (I suggest the Interactive Field Extractor). After that, you will be able to run statistics, etc.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=/your/file/name/here
| table Case speed   strength  weight  height 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Mar 2013 19:14:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-a-sql-case-statement-into-different-events/m-p/68415#M17135</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-03-20T19:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a sql case statement into different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-a-sql-case-statement-into-different-events/m-p/68416#M17136</link>
      <description>&lt;P&gt;Hi thanks for the response. Basically I query a database a get an output similar to the one above. I used to graph it in excel and compared speed, strength etc on seperate graphs but the way that Splunk logs it is difficult to plot all the strength values on one graph, speed on one graph etc.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 09:34:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-a-sql-case-statement-into-different-events/m-p/68416#M17136</guid>
      <dc:creator>swilson91</dc:creator>
      <dc:date>2013-03-21T09:34:36Z</dc:date>
    </item>
  </channel>
</rss>

