<?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: Can I use SED in configuration files? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52422#M10089</link>
    <description>&lt;P&gt;Can you provide a sample event?&lt;/P&gt;</description>
    <pubDate>Sat, 31 Aug 2013 01:34:03 GMT</pubDate>
    <dc:creator>rturk</dc:creator>
    <dc:date>2013-08-31T01:34:03Z</dc:date>
    <item>
      <title>Can I use SED in configuration files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52421#M10088</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I am fairly new to Splunk and have been working on the following search time field extraction to grab windows formatted filenames from various different custom logs and was wondering if and how somehting like this can be made to automatically extract fields for a giver app. I believe this will require work in props.conf and use of SED scripts but was wondering if anyone could point me into the right direction as I wouldn't know where to start. Any help would be greatly appreciate:&lt;/P&gt;

&lt;P&gt;| rex "(?(( |TrustedInsta|//)+[-a-zA-Z0-9)/(. ]+.(exe|dll|bat)$))" | rex mode=sed field=extractfilename "s/^[a-zA-Z0-9][ ]+ //" | rex mode=sed field=extract_filename "s/^ *//" | rex mode=sed field=extract_filename "s/^TrustedInsta//" | rex "(?(\+[a-zA-Z0-9]+.(exe|dll|bat)\"))" | eval FILE=mvappend(extractfilename, " ", extractfilename2) &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:41:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52421#M10088</guid>
      <dc:creator>maxdessureault</dc:creator>
      <dc:date>2020-09-28T14:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use SED in configuration files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52422#M10089</link>
      <description>&lt;P&gt;Can you provide a sample event?&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2013 01:34:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52422#M10089</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2013-08-31T01:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use SED in configuration files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52423#M10090</link>
      <description>&lt;P&gt;Sure here are a few different one which the above work with&lt;/P&gt;

&lt;P&gt;07/13/2009  09:41 PM           169,472 NT SERVICE\TrustedInstaPortableDeviceWiaCompat.dll&lt;/P&gt;

&lt;P&gt;0x00000000fd1b0000  0x51000   C:\WINDOWS\system32\msv10.DLL&lt;/P&gt;

&lt;P&gt;The field extraction itself is working to my liking. My problem is getting the series of SED and REX into the config files as to automatically extract the FILE field when accessing a particular app or whatnot.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2013 01:53:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52423#M10090</guid>
      <dc:creator>maxdessureault</dc:creator>
      <dc:date>2013-08-31T01:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use SED in configuration files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52424#M10091</link>
      <description>&lt;P&gt;sedcmd in props.conf&lt;/P&gt;

&lt;P&gt;here is an example:&lt;/P&gt;

&lt;P&gt;[your sourcetype]&lt;/P&gt;

&lt;P&gt;sedcmd-extractfilename = s\/^[a-zA-Z0-9][ ]+ \/\/g&lt;/P&gt;

&lt;P&gt;This of course if your regex is working properly.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2013 13:09:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52424#M10091</guid>
      <dc:creator>davecroto</dc:creator>
      <dc:date>2013-08-31T13:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use SED in configuration files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52425#M10092</link>
      <description>&lt;P&gt;Ah great actually all I needed to know my stuff is all good now thanks for the nudge.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2013 02:42:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52425#M10092</guid>
      <dc:creator>maxdessureault</dc:creator>
      <dc:date>2013-09-01T02:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use SED in configuration files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52426#M10093</link>
      <description>&lt;P&gt;Revive old post.&lt;/P&gt;

&lt;P&gt;I have lines of data with below values&lt;/P&gt;

&lt;P&gt;WORK_ORD_NO,ACT_ID,ACT_NO,ACT_NM,STATUS_CD,LAST_UPDATE_DT,DELAY_REASON_DESC&lt;BR /&gt;
AFP5850001,3,0,Activity_A,DLY,1/7/2015 10:22,LINE_ID_NOT_FOUND:62364588:&lt;BR /&gt;
AFP5849001,3,0,Activity_A,DLY,1/7/2015 10:22,LINE_ID_NOT_FOUND:62645015:&lt;BR /&gt;
AFP5843001,3,0,Activity_A,DLY,1/7/2015 10:22,LINE_ID_NOT_FOUND:62625062:&lt;/P&gt;

&lt;P&gt;I expect results like below:&lt;BR /&gt;
WORK_ORD_NO,ACT_ID,ACT_NO,ACT_NM,STATUS_CD,LAST_UPDATE_DT,DELAY_REASON_DESC&lt;BR /&gt;
AFP5850001,3,0,Activity_A,DLY,1/7/2015 10:22,LINE_ID_NOT_FOUND::&lt;BR /&gt;
AFP5849001,3,0,Activity_A,DLY,1/7/2015 10:22,LINE_ID_NOT_FOUND::&lt;BR /&gt;
AFP5843001,3,0,Activity_A,DLY,1/7/2015 10:22,LINE_ID_NOT_FOUND::&lt;/P&gt;

&lt;P&gt;And I use sed stanza like below&lt;BR /&gt;
props.conf&lt;BR /&gt;
[source::C:\Program Files\Splunk/etc/apps/MySampleApp/samples/Order_Activities.csv]&lt;BR /&gt;
SEDCMD-LINE_ID_NOT_FOUND = -r s/LINE_ID_NOT_FOUND:([0-9]){8}/LINE_ID_NOT_FOUND/g&lt;/P&gt;

&lt;P&gt;but not working!&lt;/P&gt;

&lt;P&gt;Appreciate if any experts can help me here.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:41:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52426#M10093</guid>
      <dc:creator>imanpoeiri</dc:creator>
      <dc:date>2020-09-29T06:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use SED in configuration files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52427#M10094</link>
      <description>&lt;P&gt;Fixed!&lt;/P&gt;

&lt;P&gt;[source::C:Program FilesSplunk/etc/apps/MySampleApp/samples/Order_Activities.csv]&lt;BR /&gt;
SEDCMD-LINE_ID_NOT_FOUND = -r s/LINE_ID_NOT_FOUND:([0-9]){8}/LINE_ID_NOT_FOUND/g&lt;/P&gt;

&lt;P&gt;[Order_Activities.csv]&lt;BR /&gt;
SEDCMD-LINE_ID_NOT_FOUND = s/LINE_ID_NOT_FOUND:[0-9]*/LINE_ID_NOT_FOUND/g&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:46:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-SED-in-configuration-files/m-p/52427#M10094</guid>
      <dc:creator>imanpoeiri</dc:creator>
      <dc:date>2020-09-29T06:46:16Z</dc:date>
    </item>
  </channel>
</rss>

