<?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 break events and extract fields from Scripted Input in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179604#M51702</link>
    <description>&lt;P&gt;Do you mean having a hash tables or arrays.?&lt;/P&gt;</description>
    <pubDate>Wed, 05 Nov 2014 09:26:02 GMT</pubDate>
    <dc:creator>dilipbailwal</dc:creator>
    <dc:date>2014-11-05T09:26:02Z</dc:date>
    <item>
      <title>How to break events and extract fields from Scripted Input</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179602#M51700</link>
      <description>&lt;P&gt;Here is the sample data&lt;/P&gt;

&lt;P&gt;AppPoolName : TestApp&lt;BR /&gt;
PrivateMemory : 2000&lt;BR /&gt;
State : Started&lt;BR /&gt;
Application :&lt;BR /&gt;
IdentityType : NetworkService&lt;BR /&gt;
RecyclingTime : 00:00:00&lt;BR /&gt;
AppPoolName : .NET v4.0&lt;BR /&gt;
PrivateMemory : 2000&lt;BR /&gt;
State : Started&lt;BR /&gt;
Application :&lt;BR /&gt;
IdentityType : ApplicationPoolIdentity&lt;BR /&gt;
RecyclingTime : 01:00:00&lt;BR /&gt;
AppPoolName : .NET v4.0 Classic&lt;BR /&gt;
PrivateMemory : 2000&lt;BR /&gt;
State : Started&lt;BR /&gt;
Application : /DefaultApp1&lt;BR /&gt;
/DefaultApp2&lt;BR /&gt;
/DefaultApp3 &lt;BR /&gt;
IdentityType : ApplicationPoolIdentity&lt;BR /&gt;
RecyclingTime : 01:00:00&lt;/P&gt;

&lt;P&gt;What i am trying to achieve is, every name on left side of colon to be as a field name and values on right side as a field value.&lt;BR /&gt;
Therefore my approach is Spliting the whole event at RecycleTime so we get multiple events and then further extracting fields using Search-Time extraction&lt;/P&gt;

&lt;P&gt;I tried various events like MUST_BREAK_AFTER, ... _BEFORE ..etc but its not splitting in to multiple event.&lt;BR /&gt;
here is my code&lt;/P&gt;

&lt;P&gt;Props.conf,&lt;BR /&gt;
[sourcetype]&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 150&lt;BR /&gt;
MUST_BREAK_AFTER = RecyclingTime&lt;BR /&gt;
NO_BINARY_CHECK = 1&lt;BR /&gt;
REPORT-1app_field = AppPoolName&lt;BR /&gt;
REPORT-2app_field = Application&lt;BR /&gt;
REPORT-3app_field = IdentityType&lt;BR /&gt;
REPORT-4app_field = PrivateMemory&lt;BR /&gt;
REPORT-5app_field = RecyclingTime&lt;BR /&gt;
REPORT-6app_field = State&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
[AppPoolName]&lt;BR /&gt;
REGEX = (?i).&lt;EM&gt;? : (?P\w+)&lt;BR /&gt;
[Application]&lt;BR /&gt;
REGEX = (?ism)Application : (?P.+)(?=IdentityType)&lt;BR /&gt;
[IdentityType]&lt;BR /&gt;
REGEX = (?i)IdentityType : (?P.+)(?=RecyclingTime)&lt;BR /&gt;
[PrivateMemory]&lt;BR /&gt;
REGEX = (?i).&lt;/EM&gt;? : (?P\d+)&lt;BR /&gt;
[RecyclingTime]&lt;BR /&gt;
REGEX = (?i).&lt;EM&gt;? : (?P\d+:\d+:\d+)&lt;BR /&gt;
[State]&lt;BR /&gt;
REGEX = (?i).&lt;/EM&gt;? : (?P\w+)&lt;/P&gt;

&lt;P&gt;can you guys suggest, what am i missing in above code to extract events and there fields.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:59:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179602#M51700</guid>
      <dc:creator>dilipbailwal</dc:creator>
      <dc:date>2020-09-28T17:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to break events and extract fields from Scripted Input</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179603#M51701</link>
      <description>&lt;P&gt;If that's a scripted input, I would suggest to code the script to format the content as key="value". I use a couple of Powershell scripts to collect data from different sources like Sharepoint, AD, EventLog, etc... and I even created a library to output each events in key=value format. Much easier!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2014 22:46:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179603#M51701</guid>
      <dc:creator>musskopf</dc:creator>
      <dc:date>2014-11-04T22:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to break events and extract fields from Scripted Input</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179604#M51702</link>
      <description>&lt;P&gt;Do you mean having a hash tables or arrays.?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2014 09:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179604#M51702</guid>
      <dc:creator>dilipbailwal</dc:creator>
      <dc:date>2014-11-05T09:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to break events and extract fields from Scripted Input</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179605#M51703</link>
      <description>&lt;P&gt;If you use a script like powershell, just make a loop and print everything as key="value", for example you data you look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2014-11-06T04:10:09.000+10:00, AppPoolName="TestApp", PrivateMemory=2000, State="Started",...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you data is already a hash is very simple to make a loop, if the data is a single string, you might need to split by ":" to load it into a hash table first. As you are already using Scripted Input, a few more lines on your script will save heaps of time on the Splunk side.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2014 21:24:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179605#M51703</guid>
      <dc:creator>musskopf</dc:creator>
      <dc:date>2014-11-05T21:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to break events and extract fields from Scripted Input</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179606#M51704</link>
      <description>&lt;P&gt;Thanks a ton mussktop, i did managed to get powershell output into splunk, by using key=value method. I have yet more complicating scenarios coming soon, like grasping all appwiz.cpl entries in splunk etc.. Thanks again for you help&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 10:34:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179606#M51704</guid>
      <dc:creator>dilipbailwal</dc:creator>
      <dc:date>2014-11-12T10:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to break events and extract fields from Scripted Input</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179607#M51705</link>
      <description>&lt;P&gt;please mark this as answered - thx&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 13:22:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-break-events-and-extract-fields-from-Scripted-Input/m-p/179607#M51705</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-11-12T13:22:24Z</dc:date>
    </item>
  </channel>
</rss>

