<?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 change format and then insert+combine them in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469249#M192029</link>
    <description>&lt;P&gt;@prot3ctor ,&lt;/P&gt;

&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Your search with fields dob,data"
|eval newString=strftime(strptime(dob,"%Y-%m-%d"),"%y%m%d")
|rex field=data "(?&amp;lt;_f&amp;gt;.)"|eval newString=replace(data,"^.",_f.newString)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 24 Oct 2019 16:22:21 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2019-10-24T16:22:21Z</dc:date>
    <item>
      <title>How to change format and then insert+combine them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469248#M192028</link>
      <description>&lt;P&gt;Hello. &lt;/P&gt;

&lt;P&gt;Could anyone help me out?&lt;BR /&gt;
I have a DoB string with the following format dob='2002-01-03' &lt;BR /&gt;
I would like to format this string to look like this: 020103&lt;/P&gt;

&lt;P&gt;And then i would like to insert this data into an other sting after the 1st number which looks like this: data='1384198'&lt;/P&gt;

&lt;P&gt;So in the end i would get data2='1020103384198'&lt;/P&gt;

&lt;P&gt;Thank you &lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 15:11:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469248#M192028</guid>
      <dc:creator>prot3ctor</dc:creator>
      <dc:date>2019-10-24T15:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format and then insert+combine them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469249#M192029</link>
      <description>&lt;P&gt;@prot3ctor ,&lt;/P&gt;

&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Your search with fields dob,data"
|eval newString=strftime(strptime(dob,"%Y-%m-%d"),"%y%m%d")
|rex field=data "(?&amp;lt;_f&amp;gt;.)"|eval newString=replace(data,"^.",_f.newString)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Oct 2019 16:22:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469249#M192029</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-10-24T16:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format and then insert+combine them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469250#M192030</link>
      <description>&lt;P&gt;Will try. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 14:32:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469250#M192030</guid>
      <dc:creator>prot3ctor</dc:creator>
      <dc:date>2019-10-31T14:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format and then insert+combine them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469251#M192031</link>
      <description>&lt;P&gt;Hi. So this only puts the 2 strings next to each other. Is there a way to insert 1 string after the 1st character of the 2nd string?&lt;BR /&gt;
Example: &lt;BR /&gt;
dob=861010&lt;BR /&gt;
ssn=123456&lt;/P&gt;

&lt;P&gt;So in the end i would get a value what looks like this: 186101023456&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 17:14:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469251#M192031</guid>
      <dc:creator>prot3ctor</dc:creator>
      <dc:date>2019-11-17T17:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format and then insert+combine them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469252#M192032</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval dob="2002-01-03", data="1384198"

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| eval data2 = substr(data, 1, 1). replace(dob, "^..|-", "") . substr(data, 2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Nov 2019 22:25:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469252#M192032</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-17T22:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format and then insert+combine them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469253#M192033</link>
      <description>&lt;P&gt;@prot3ctor ,&lt;/P&gt;

&lt;P&gt;This is what I tried with the strings you provided&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults|eval dob="2002-01-03",data="1384198"
|eval newString=strftime(strptime(dob,"%Y-%m-%d"),"%y%m%d")
|rex field=data "(?&amp;lt;_f&amp;gt;.)"|eval newString=replace(data,"^.",_f.newString)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and the result is &lt;CODE&gt;1020103384198&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;dob="2002-01-03" =&amp;gt; 020103&lt;BR /&gt;
date = 1384198&lt;BR /&gt;
Result = 1 020103 384198&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 04:46:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469253#M192033</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-11-18T04:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format and then insert+combine them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469254#M192034</link>
      <description>&lt;P&gt;It wasnt working for me at 1st  cause i had to strip the single quotes from data first. Then i managed to get it to work&lt;/P&gt;

&lt;P&gt;Thanks a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 21:54:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469254#M192034</guid>
      <dc:creator>prot3ctor</dc:creator>
      <dc:date>2019-11-18T21:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format and then insert+combine them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469255#M192035</link>
      <description>&lt;P&gt;It wasnt working for me at 1st cause i had to strip the single quotes from data first. Then i managed to get it to work&lt;/P&gt;

&lt;P&gt;Thanks a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 21:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-and-then-insert-combine-them/m-p/469255#M192035</guid>
      <dc:creator>prot3ctor</dc:creator>
      <dc:date>2019-11-18T21:55:54Z</dc:date>
    </item>
  </channel>
</rss>

