Question: I have the following configuration file. But when I run this, I get the timestamp changed in the terminal but the log is not shipped to ElasticSearch. 

Here is the configuration file:

```
input {
stdin {
    type => "stdin-type"
  }
}
filter {

  grok {
    type => "stdin-type"
    patterns_dir=>["./patterns"]
    pattern => "%{PARSE_ERROR}"
    add_tag=>"%{type1},%{type2},%{slave},ERR_SYSTEM"
  }

mutate
{
    type=>"stdin-type"
    replace => ["@message", "%{message}" ]
replace =>["@timestamp","2013-05-09T05:19:16.876Z"]

}

}
output {
  stdout { debug => true debug_format => "json"}
  elasticsearch
{
}
}

```

On removing the replace line, the log gets shipped. Where am I going wrong?

Answer: 
That is not a valid regex. Use `/` as modifiers:

```
/\[url\s?=\s?"?(.*?)"?\](.*?)\[\/url\]/

```

making the function:

```
function processJs() {
    var oldtext = $("#oldtext").html();
    var newtext = oldtext.replace(/\[url\s?=\s?"?(.*?)"?\](.*?)\[\/url\]/g, '<a href="$1">$2</a>');
    $('#mydiv').html(newtext);
}

```

`g` at the end will repeat it over the text. Here is a fiddle: <http://jsfiddle.net/xe2F9/>
```
var newtext = oldtext.replace(/\[url\s?=\s?"?(.*?)"?\](.*?)\[\/url\]/g, '<a href="$1">$2</a>');

```

You specify the 'search' as a RegEx object - not a string. 

Just using /.../ will automatically crate one transparently.