Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results forย

Splunk Search

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results forย

- Community
- :
- Splunk Answers
- :
- Using Splunk
- :
- Splunk Search
- :
- Why Splunk is telling me that my eval expression i...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark Topic
- Subscribe to Topic
- Mute Topic
- Printer Friendly Page

- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

tcmarquesi

Explorer

โ09-12-2016
05:40 AM

I'm trying to evaluate the normal distribuiton's PDF into my search as follows:

`... | eval prob=(1/sqrt(2*pi()*sigma^2))*exp(-((x-mi)^2)/(2*sigma^2))`

And I'm getting this error message:

*Error in 'eval' command: The expression is malformed. Expected ).*

What am I doing wrong? I tested the expression on Excel and it works fine...

1 Solution

- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

sundareshr

Legend

โ09-12-2016
07:39 AM

I haven't tested this, but at first glance, it could be because of the the power of function. Change all occurences of `sigma^2`

to `pow(sigma, 2)`

. So your formula s/b written like this

```
(1/sqrt(2*pi()*pow(sigma,2)))*exp(-(pow((x-mi),2))/(2*pow(sigma, 2)))
```

- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

sundareshr

Legend

โ09-12-2016
07:39 AM

I haven't tested this, but at first glance, it could be because of the the power of function. Change all occurences of `sigma^2`

to `pow(sigma, 2)`

. So your formula s/b written like this

```
(1/sqrt(2*pi()*pow(sigma,2)))*exp(-(pow((x-mi),2))/(2*pow(sigma, 2)))
```

- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

tcmarquesi

Explorer

โ09-12-2016
08:59 AM

Thank you!